From cdac7609fd7f102cd65774ed93b28572dbaa409b Mon Sep 17 00:00:00 2001 From: Drew Short Date: Sun, 29 Dec 2019 18:30:39 -0600 Subject: [PATCH] Handle RECONNECTING and reduce initial sync --- bot/bot.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bot/bot.js b/bot/bot.js index 37a1d92..20d0707 100644 --- a/bot/bot.js +++ b/bot/bot.js @@ -30,6 +30,9 @@ class Bot { case "SYNCING": logger.debug("Syncing") break; + case "RECONNECTING": + logger.debug("Reconnecting"); + break; default: logger.error("Unexpected sync state: %s", state); process.exit(1); @@ -50,11 +53,13 @@ class Bot { return this; } - connect() { + async connect() { // logger.info("Initializing Crypto"); // await bot.client.initCrypto(); logger.info("Starting Matrix SDK Client"); - this.client.startClient(); + await this.client.startClient({ + initialSyncLimit: 0 + }); } sendStatusStartup() {