Upgrade 2 messages every 30 seconds

This results in 4 messages per minute or 240 messages per hour.
This commit is contained in:
Daniel Gasienica 2018-03-23 10:17:06 -04:00
parent 7c2fde4433
commit 9b112489cd
2 changed files with 4 additions and 3 deletions

View file

@ -79,16 +79,17 @@
/* eslint-enable */
/* jshint ignore:start */
const NUM_MESSAGE_UPGRADES_PER_IDLE = 2;
const idleDetector = new IdleDetector();
idleDetector.on('idle', async () => {
const results = await MessageDataMigrator.processNext({
BackboneMessage: Whisper.Message,
BackboneMessageCollection: Whisper.MessageCollection,
count: 3,
count: NUM_MESSAGE_UPGRADES_PER_IDLE,
upgradeMessageSchema,
wrapDeferred,
});
console.log('Message schema upgrade:', results);
console.log('Upgrade message schema:', results);
if (!results.hasMore) {
idleDetector.stop();

View file

@ -3,7 +3,7 @@
const EventEmitter = require('events');
const POLL_INTERVAL_MS = 10 * 1000;
const POLL_INTERVAL_MS = 30 * 1000;
const IDLE_THRESHOLD_MS = 25;
class IdleDetector extends EventEmitter {