Extract NUM_MESSAGES_PER_BATCH

This commit is contained in:
Daniel Gasienica 2018-03-27 12:15:14 -04:00
parent 85788d3c4a
commit 3c57dbfb56

View file

@ -15,6 +15,7 @@ const DATABASE_NAME = 'signal';
const EXPECTED_DATABASE_VERSION = 17;
const MESSAGES_STORE_NAME = 'messages';
const ITEMS_STORE_NAME = 'items';
const NUM_MESSAGES_PER_BATCH = 50;
exports.processNext = async ({
BackboneMessage,
@ -104,7 +105,7 @@ exports.processAll = async ({
// eslint-disable-next-line no-await-in-loop
await _dangerouslyFetchMessagesRequiringSchemaUpgradeWithoutIndex({
connection,
count: 10,
count: NUM_MESSAGES_PER_BATCH,
lastIndex: lastProcessedIndex,
});
const fetchDuration = Date.now() - fetchUnprocessedMessagesStartTime;