Skip to content

Commit b1827cb

Browse files
committed
remove callback based deleteMany from attachment storage. In on-copy.js use async version
1 parent 3c9ecc7 commit b1827cb

2 files changed

Lines changed: 1 addition & 13 deletions

File tree

lib/attachment-storage.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,6 @@ class AttachmentStorage {
3636
return this.storage.createReadStream(id, attachmentData, options);
3737
}
3838

39-
deleteMany(ids, magic, callback) {
40-
let pos = 0;
41-
let deleteNext = () => {
42-
if (pos >= ids.length) {
43-
return callback(null, true);
44-
}
45-
let id = ids[pos++];
46-
this.delete(id, magic, deleteNext);
47-
};
48-
deleteNext();
49-
}
50-
5139
updateMany(ids, count, magic, callback) {
5240
return this.storage.update(ids, count, magic, callback);
5341
}

lib/handlers/on-copy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ async function copyHandler(server, messageHandler, connection, mailbox, update,
289289
key => prepared.mimeTree.attachmentMap[key]
290290
);
291291

292-
messageHandler.attachmentStorage.deleteMany(attachmentIds, maildata.magic, () => {});
292+
messageHandler.attachmentStorage.deleteManyAsync(attachmentIds, maildata.magic);
293293

294294
if (err) {
295295
return reject(err);

0 commit comments

Comments
 (0)