Skip to content

Commit 60bca78

Browse files
committed
ZMS-3: remove no-locking for sub-chunksize attachments
1 parent 3eadb47 commit 60bca78

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lib/attachments/gridstore-storage.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,6 @@ class GridstoreStorage {
231231
return done();
232232
}
233233

234-
if (attachment.body.length < 255 * 1024) {
235-
// a single chunk attachment, no need for locking
236-
return done();
237-
}
238-
239234
// Try to get a lock
240235
// Using locks is required to prevent multiple messages storing the same large attachment at
241236
// the same time.
@@ -305,12 +300,15 @@ class GridstoreStorage {
305300
}
306301

307302
// partial chunks for a probably deleted message detected, try to clean up
308-
setTimeout(() => {
309-
if (returned) {
310-
return;
311-
}
312-
this.cleanupGarbage(id, tryStore);
313-
}, 100 + 200 * Math.random());
303+
setTimeout(
304+
() => {
305+
if (returned) {
306+
return;
307+
}
308+
this.cleanupGarbage(id, tryStore);
309+
},
310+
100 + 200 * Math.random()
311+
);
314312
}
315313
);
316314
} else {

0 commit comments

Comments
 (0)