mirror of
https://github.com/kevinthedang/discord-ollama.git
synced 2025-12-12 19:56:06 -05:00
Update: same catch method for redis
This commit is contained in:
@@ -33,15 +33,16 @@ const messageHistory: Queue<UserMessage> = new Queue<UserMessage>
|
|||||||
registerEvents(client, Events, messageHistory, ollama, Keys.defaultModel)
|
registerEvents(client, Events, messageHistory, ollama, Keys.defaultModel)
|
||||||
|
|
||||||
// Try to connect to redis
|
// Try to connect to redis
|
||||||
try {
|
await redis.connect()
|
||||||
await redis.connect()
|
.then(response => {
|
||||||
console.log('[Redis] Successfully Connected')
|
console.log('[Redis] Successfully Connected')
|
||||||
} catch(error) {
|
})
|
||||||
console.error('[Redis] Connection Error. See error below:\n', error)
|
.catch(error => {
|
||||||
console.warn('[Redis] Failed to connect to Redis Database, using local system')
|
console.error('[Redis] Connection Error. See error below:\n', error)
|
||||||
// TODO: create boolean flag that will probably be used in messageCreate.ts if redis database is down
|
console.warn('[Redis] Failed to connect to Redis Database, using local system')
|
||||||
// When implementing this boolean flag, move connection to database BEFORE the registerEvents method
|
// 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
|
// Try to log in the client
|
||||||
await client.login(Keys.clientToken)
|
await client.login(Keys.clientToken)
|
||||||
|
|||||||
Reference in New Issue
Block a user