From e6d62cb22c8c97fe632c2150b3575389e7c821d9 Mon Sep 17 00:00:00 2001 From: Mikunj Date: Wed, 11 Sep 2019 16:32:47 +1000 Subject: [PATCH] Review changes. Increase mod time to 30 seconds. --- js/modules/loki_public_chat_api.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/modules/loki_public_chat_api.js b/js/modules/loki_public_chat_api.js index 110885d5c..d0f70ba04 100644 --- a/js/modules/loki_public_chat_api.js +++ b/js/modules/loki_public_chat_api.js @@ -8,7 +8,7 @@ const { URL, URLSearchParams } = require('url'); const PUBLICCHAT_MSG_POLL_EVERY = 1.5 * 1000; // 1.5s const PUBLICCHAT_CHAN_POLL_EVERY = 20 * 1000; // 20s const PUBLICCHAT_DELETION_POLL_EVERY = 5 * 1000; // 5s -const PUBLICCHAT_MOD_POLL_EVERY = 5 * 1000; // 1 second +const PUBLICCHAT_MOD_POLL_EVERY = 30 * 1000; // 30s // singleton to relay events to libtextsecure/message_receiver class LokiPublicChatAPI extends EventEmitter { @@ -228,6 +228,9 @@ class LokiPublicChannelAPI { if (this.timers.channel) { clearTimeout(this.timers.channel); } + if (this.timers.moderator) { + clearTimeout(this.timers.moderator); + } if (this.timers.delete) { clearTimeout(this.timers.delete); } @@ -315,7 +318,7 @@ class LokiPublicChannelAPI { log.warn(`Error while polling for public chat moderators: ${e}`); } if (this.running) { - this.timers.channel = setTimeout(() => { + this.timers.moderator = setTimeout(() => { this.pollForModerators(); }, PUBLICCHAT_MOD_POLL_EVERY); }