Files
speckle-server/packages/server/modules/shared/helpers/bullHelper.ts
T
Iain Sproat 9ed1656541 fix(redis): Redis errors should be logged in a structured manner (#1389)
- errors should be logged to stdout in a structured format
- currently still throws errors which are ultimately unhandled, this matches existing behaviour
- Consolidate redis creation and error handling in a shared module
* remove unused 'redis' module, in favour of 'ioredis'
2023-02-22 09:13:05 +00:00

21 lines
532 B
TypeScript

import Bull from 'bull'
import { getRedisUrl } from '@/modules/shared/helpers/envHelper'
import { createRedisClient } from '@/modules/shared/redis/redis'
export function buildBaseQueueOptions(): Bull.QueueOptions {
return {
createClient: (type) => {
const client = createRedisClient(getRedisUrl(), {
...(['bclient', 'subscriber'].includes(type)
? {
enableReadyCheck: false,
maxRetriesPerRequest: null
}
: {})
})
return client
}
}
}