mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
fix(bulk-email): wait 5s per 250 messages for server queue
This commit is contained in:
parent
e1f9cac37a
commit
aee08ba0f9
1 changed files with 5 additions and 2 deletions
|
|
@ -8,13 +8,16 @@ const BASE_URL = nconf.get('BASE_URL');
|
|||
const EMAIL_SLUG = 'mandrill-email-slug'; // Set email template to send
|
||||
const MIGRATION_NAME = 'bulk-email';
|
||||
|
||||
const progressCount = 1000;
|
||||
const progressCount = 250;
|
||||
let count = 0;
|
||||
|
||||
async function updateUser (user) {
|
||||
count += 1;
|
||||
|
||||
if (count % progressCount === 0) console.warn(`${count} ${user._id}`);
|
||||
if (count % progressCount === 0) {
|
||||
console.warn(`${count} ${user._id}`);
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
}
|
||||
|
||||
await sendTxn(
|
||||
user,
|
||||
|
|
|
|||
Loading…
Reference in a new issue