@@ -12,7 +12,7 @@ import {
1212} from "../../email/services/send-email.service" ;
1313import { BusinessRuleException } from "../../errors/exceptions/business-rule.exception" ;
1414import { findWorkspaceUsers } from "../../workspaces/services/workspace.service" ;
15- import { redisConnection } from "../../../bull-mq/redis-connection" ;
15+ import { getRedisConnection } from "../../../bull-mq/redis-connection" ;
1616import { UnknownException } from "../../errors/exceptions/unknown.exception" ;
1717
1818export const DEFAULT_SYNC_BATCH_SINCE_DAYS_AGO = 365 ; // TO-DO: Should be a workspace setting
@@ -45,7 +45,7 @@ export const setSyncBatchProgress = async (syncBatchId: number) => {
4545 const key = `sync-batch:${ syncBatchId } :sync` ;
4646 const sevenDaysInSeconds = 60 * 60 * 24 * 7 ;
4747
48- await redisConnection
48+ await getRedisConnection ( )
4949 . multi ( )
5050 . hset ( key , { waiting : 0 , done : 0 } )
5151 . expire ( key , sevenDaysInSeconds )
@@ -59,12 +59,12 @@ export const incrementSyncBatchProgress = async (
5959) => {
6060 const key = `sync-batch:${ syncBatchId } :sync` ;
6161
62- await redisConnection . hincrby ( key , field , amount ) ;
62+ await getRedisConnection ( ) . hincrby ( key , field , amount ) ;
6363} ;
6464
6565export const getSyncBatchProgress = async ( syncBatchId : number ) => {
6666 try {
67- const progress = await redisConnection . hgetall (
67+ const progress = await getRedisConnection ( ) . hgetall (
6868 `sync-batch:${ syncBatchId } :sync`
6969 ) ;
7070
0 commit comments