@social-mail/social-mail-web-server 1.7.308 → 1.7.310
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -63,6 +63,7 @@ export default class BaseDiskCache {
|
|
|
63
63
|
async clear() {
|
|
64
64
|
try {
|
|
65
65
|
const path = this.root;
|
|
66
|
+
using lock = await LockFile.lock(`df-clear:${path}`);
|
|
66
67
|
if (!existsSync(path)) {
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
@@ -77,6 +78,7 @@ export default class BaseDiskCache {
|
|
|
77
78
|
|
|
78
79
|
async clearFolder(path: string) {
|
|
79
80
|
try {
|
|
81
|
+
using lock = await LockFile.lock(`df-clear:${path}`);
|
|
80
82
|
path = join(this.root, path);
|
|
81
83
|
if (!existsSync(path)) {
|
|
82
84
|
return;
|
|
@@ -115,7 +117,7 @@ export default class BaseDiskCache {
|
|
|
115
117
|
return new LocalFile(path, void 0, void 0, doNothing);
|
|
116
118
|
}
|
|
117
119
|
|
|
118
|
-
using lock = await LockFile.lock(path);
|
|
120
|
+
using lock = await LockFile.lock(`df:${path}`);
|
|
119
121
|
|
|
120
122
|
if (existsSync(path)) {
|
|
121
123
|
return new LocalFile(path, void 0, void 0, doNothing);
|
|
@@ -127,6 +129,7 @@ export default class BaseDiskCache {
|
|
|
127
129
|
await factory(new LocalFile(tmpPath, void 0, void 0, doNothing));
|
|
128
130
|
|
|
129
131
|
try {
|
|
132
|
+
ensureDir(parsedPath.dir);
|
|
130
133
|
await fsp.rename(tmpPath, path);
|
|
131
134
|
} catch (e) {
|
|
132
135
|
|