mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-11-10 17:47:07 +08:00
Merge pull request #442 from nodemailer/ZMS-57
Do not use sorting for mass action tasks
This commit is contained in:
commit
ff46dab195
1 changed files with 1 additions and 13 deletions
|
@ -35,7 +35,7 @@ let run = async (task, data, options) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let cursor = await db.database.collection('messages').find(filter).sort({ uid: -1 });
|
let cursor = await db.database.collection('messages').find(filter);
|
||||||
|
|
||||||
let messageData;
|
let messageData;
|
||||||
|
|
||||||
|
@ -51,18 +51,6 @@ let run = async (task, data, options) => {
|
||||||
|
|
||||||
if (action.moveTo && action.moveTo.toString() !== messageData.mailbox.toString()) {
|
if (action.moveTo && action.moveTo.toString() !== messageData.mailbox.toString()) {
|
||||||
try {
|
try {
|
||||||
console.log({
|
|
||||||
user,
|
|
||||||
source: {
|
|
||||||
user: messageData.user,
|
|
||||||
mailbox: messageData.mailbox
|
|
||||||
},
|
|
||||||
destination: {
|
|
||||||
mailbox: mailboxData._id
|
|
||||||
},
|
|
||||||
updates: Object.keys(updates).length ? updates : false,
|
|
||||||
messageQuery: messageData.uid
|
|
||||||
});
|
|
||||||
await moveMessage({
|
await moveMessage({
|
||||||
user,
|
user,
|
||||||
source: {
|
source: {
|
||||||
|
|
Loading…
Reference in a new issue