Fix: redis workaround for local non docker
This commit is contained in:
@@ -33,12 +33,15 @@ 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
|
||||||
await redis.connect()
|
try {
|
||||||
.then(() => console.log('[Redis] Connected'))
|
await redis.connect()
|
||||||
.catch((error) => {
|
console.log('[Redis] Successfully Connected')
|
||||||
console.error('[Redis] Connection Error', error)
|
} catch(error) {
|
||||||
process.exit(1)
|
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
|
// Try to log in the client
|
||||||
await client.login(Keys.clientToken)
|
await client.login(Keys.clientToken)
|
||||||
|
|||||||
Reference in New Issue
Block a user