From 5c8cb6b89be45a1c1dd790f87c4aa25fd0f749b4 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Tue, 30 Mar 2021 09:56:03 -0700 Subject: [PATCH] Decrease batcher wait time to speed up startup --- ts/textsecure/MessageReceiver.ts | 6 +++--- ts/util/messageBatcher.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ts/textsecure/MessageReceiver.ts b/ts/textsecure/MessageReceiver.ts index e9f543ed9037..c77a5cd70e42 100644 --- a/ts/textsecure/MessageReceiver.ts +++ b/ts/textsecure/MessageReceiver.ts @@ -205,7 +205,7 @@ class MessageReceiverInner extends EventTarget { this.cacheAddBatcher = createBatcher({ name: 'MessageReceiver.cacheAddBatcher', - wait: 200, + wait: 75, maxSize: 30, processBatch: (items: Array) => { // Not returning the promise here because we don't want to stall @@ -215,13 +215,13 @@ class MessageReceiverInner extends EventTarget { }); this.cacheUpdateBatcher = createBatcher({ name: 'MessageReceiver.cacheUpdateBatcher', - wait: 500, + wait: 75, maxSize: 30, processBatch: this.cacheUpdateBatch.bind(this), }); this.cacheRemoveBatcher = createBatcher({ name: 'MessageReceiver.cacheRemoveBatcher', - wait: 500, + wait: 75, maxSize: 30, processBatch: this.cacheRemoveBatch.bind(this), }); diff --git a/ts/util/messageBatcher.ts b/ts/util/messageBatcher.ts index 8fbed527a86a..5c2fbbf20494 100644 --- a/ts/util/messageBatcher.ts +++ b/ts/util/messageBatcher.ts @@ -7,7 +7,7 @@ import { createWaitBatcher } from './waitBatcher'; const updateMessageBatcher = createBatcher({ name: 'messageBatcher.updateMessageBatcher', - wait: 500, + wait: 75, maxSize: 50, processBatch: async (messageAttrs: Array) => { window.log.info('updateMessageBatcher', messageAttrs.length); @@ -33,7 +33,7 @@ export function setBatchingStrategy(keepBatching = false): void { export const saveNewMessageBatcher = createWaitBatcher({ name: 'messageBatcher.saveNewMessageBatcher', - wait: 500, + wait: 75, maxSize: 30, processBatch: async (messageAttrs: Array) => { window.log.info('saveNewMessageBatcher', messageAttrs.length);