Fix creation of redis clients
This commit is contained in:
@ -15,7 +15,7 @@ import { config, loggers } from 'winston'
|
||||
import { makeApolloServer } from './apollo'
|
||||
import { appDataSource } from './data_source'
|
||||
import { env } from './env'
|
||||
import { redisClient } from './redis'
|
||||
import { redisClient, mqRedisClient } from './redis'
|
||||
import { articleRouter } from './routers/article_router'
|
||||
import { authRouter } from './routers/auth/auth_router'
|
||||
import { mobileAuthRouter } from './routers/auth/mobile/mobile_auth_router'
|
||||
@ -163,6 +163,13 @@ const main = async (): Promise<void> => {
|
||||
console.log('Redis Client Connected:', env.redis.url)
|
||||
}
|
||||
|
||||
// redis for message queue
|
||||
if (env.redis.url) {
|
||||
mqRedisClient?.on('error', (err) => {
|
||||
console.error('Redis Client Error', err)
|
||||
})
|
||||
}
|
||||
|
||||
const { app, apollo, httpServer } = createApp()
|
||||
|
||||
await apollo.start()
|
||||
|
||||
Reference in New Issue
Block a user