only disconnect redis message queue client if it is different from cache client
This commit is contained in:
@ -1,19 +1,8 @@
|
||||
import { Readability } from '@omnivore/readability'
|
||||
import { RedisDataSource } from '@omnivore/utils'
|
||||
import Redis from 'ioredis'
|
||||
import { ArticleSavingRequestStatus, ImportContext } from '../src'
|
||||
|
||||
export const stubImportCtx = (): ImportContext => {
|
||||
const redisDataSource = new RedisDataSource({
|
||||
cache: {
|
||||
url: process.env.REDIS_URL,
|
||||
cert: process.env.REDIS_CERT,
|
||||
},
|
||||
mq: {
|
||||
url: process.env.MQ_REDIS_URL,
|
||||
cert: process.env.MQ_REDIS_CERT,
|
||||
},
|
||||
})
|
||||
|
||||
export const stubImportCtx = (redisClient: Redis): ImportContext => {
|
||||
return {
|
||||
userId: '',
|
||||
countImported: 0,
|
||||
@ -35,7 +24,7 @@ export const stubImportCtx = (): ImportContext => {
|
||||
): Promise<void> => {
|
||||
return Promise.resolve()
|
||||
},
|
||||
redisClient: redisDataSource.cacheClient,
|
||||
redisClient,
|
||||
taskId: '',
|
||||
source: 'csv-importer',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user