mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-01 05:06:44 +08:00
do not count stats only for a single page
This commit is contained in:
parent
803e21a9a8
commit
be50d27467
1 changed files with 4 additions and 3 deletions
|
@ -130,6 +130,10 @@ module.exports = (server, messageHandler, userCache) => (mailbox, options, sessi
|
|||
|
||||
let lastUid = false;
|
||||
|
||||
let startTime = Date.now();
|
||||
let rowCount = 0;
|
||||
let totalBytes = 0;
|
||||
|
||||
// instead of fetching all messages at once from a large mailbox
|
||||
// we page it into smaller queries
|
||||
let processPage = () => {
|
||||
|
@ -174,9 +178,6 @@ module.exports = (server, messageHandler, userCache) => (mailbox, options, sessi
|
|||
cursor = cursor.batchSize(1000);
|
||||
}
|
||||
|
||||
let startTime = Date.now();
|
||||
let rowCount = 0;
|
||||
let totalBytes = 0;
|
||||
let processedCount = 0;
|
||||
let processNext = () => {
|
||||
cursor.next((err, messageData) => {
|
||||
|
|
Loading…
Reference in a new issue