From 1b7c927a3a2f15f7769a83f2301e8f47476e375e Mon Sep 17 00:00:00 2001 From: Kevin Dang Date: Tue, 17 Jun 2025 07:06:41 -0700 Subject: [PATCH] Update: same catch method for redis --- src/client.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/client.ts b/src/client.ts index bd5d856..7fa4034 100644 --- a/src/client.ts +++ b/src/client.ts @@ -33,15 +33,16 @@ const messageHistory: Queue = new Queue registerEvents(client, Events, messageHistory, ollama, Keys.defaultModel) // Try to connect to redis -try { - await redis.connect() - console.log('[Redis] Successfully Connected') -} catch(error) { - console.error('[Redis] Connection Error. See error below:\n', error) - console.warn('[Redis] Failed to connect to Redis Database, using local system') - // TODO: create boolean flag that will probably be used in messageCreate.ts if redis database is down - // When implementing this boolean flag, move connection to database BEFORE the registerEvents method -} +await redis.connect() + .then(response => { + console.log('[Redis] Successfully Connected') + }) + .catch(error => { + console.error('[Redis] Connection Error. See error below:\n', error) + console.warn('[Redis] Failed to connect to Redis Database, using local system') + // TODO: create boolean flag that will probably be used in messageCreate.ts if redis database is down + // When implementing this boolean flag, move connection to database BEFORE the registerEvents method + }) // Try to log in the client await client.login(Keys.clientToken)