9ed1656541
- 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'
21 lines
532 B
TypeScript
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
|
|
}
|
|
}
|
|
}
|