mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-09-20 07:16:05 +08:00
use object for sorting
This commit is contained in:
parent
1676c7336f
commit
fafc124f83
|
@ -55,7 +55,7 @@ module.exports = (server, messageHandler) => (mailbox, update, session, callback
|
|||
mailbox: mailboxData._id,
|
||||
uid: tools.checkRangeQuery(update.messages)
|
||||
}) // no projection as we need to copy the entire message
|
||||
.sort([['uid', 1]])
|
||||
.sort({ uid: 1 })
|
||||
.maxTimeMS(consts.DB_MAX_TIME_MESSAGES);
|
||||
|
||||
let copiedMessages = 0;
|
||||
|
|
|
@ -78,7 +78,7 @@ module.exports = (server, messageHandler) => (mailbox, update, session, callback
|
|||
let cursor = db.database
|
||||
.collection('messages')
|
||||
.find(query)
|
||||
.sort([['uid', 1]])
|
||||
.sort({ uid: 1 })
|
||||
.maxTimeMS(consts.DB_MAX_TIME_MESSAGES);
|
||||
|
||||
let processNext = () => {
|
||||
|
|
|
@ -130,11 +130,12 @@ module.exports = (server, messageHandler, userCache) => (mailbox, options, sessi
|
|||
return callback(...args);
|
||||
};
|
||||
|
||||
let sort = { uid: 1 };
|
||||
let cursor = db.database
|
||||
.collection('messages')
|
||||
.find(query)
|
||||
.project(projection)
|
||||
.sort([['uid', 1]])
|
||||
.sort(sort)
|
||||
.setReadPreference('secondaryPreferred')
|
||||
.maxTimeMS(consts.DB_MAX_TIME_MESSAGES);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ module.exports = server => (path, session, callback) => {
|
|||
.project({
|
||||
uid: true
|
||||
})
|
||||
//.sort([['uid', 1]])
|
||||
//.sort({ uid: 1 })
|
||||
.maxTimeMS(consts.DB_MAX_TIME_MESSAGES)
|
||||
.toArray((err, messages) => {
|
||||
if (err) {
|
||||
|
|
|
@ -92,7 +92,7 @@ module.exports = server => (mailbox, update, session, callback) => {
|
|||
modseq: true
|
||||
})
|
||||
.maxTimeMS(consts.DB_MAX_TIME_MESSAGES)
|
||||
.sort([['uid', 1]]);
|
||||
.sort({ uid: 1 });
|
||||
|
||||
let shouldExpunge = false;
|
||||
let updateEntries = [];
|
||||
|
|
Loading…
Reference in a new issue