File tree Expand file tree Collapse file tree 7 files changed +15
-13
lines changed
Expand file tree Collapse file tree 7 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 11import IORedis from "ioredis" ;
22
3- const redisClient = new IORedis ( process . env . REDIS_URL || "redis://localhost:6379/0" , {
3+ export const REDIS_URL = process . env . REDIS_URL || "redis://localhost:6379/0" ;
4+
5+ const redisClient = new IORedis ( REDIS_URL , {
46 maxRetriesPerRequest : null ,
57} ) ;
68
Original file line number Diff line number Diff line change 11import { Queue } from "bullmq" ;
2- import redisClient from "../../database/redis"
2+ import { REDIS_URL } from "../../database/redis"
33import logger from "../../utils/logger/fileLogger" ;
44
55// Create a new queue (connected to Redis using environment variable)
66export const automationQueue = new Queue ( "automation-actions" , {
7- connection : redisClient
7+ connection : { url : REDIS_URL }
88} ) ;
99
1010export async function enqueueAutomationAction (
Original file line number Diff line number Diff line change 11import { Worker , Job } from "bullmq" ;
2- import redisClient from "../../database/redis" ;
2+ import { REDIS_URL } from "../../database/redis" ;
33import sendEmail from "./actions/sendEmail" ;
44import { getTenantHash } from "../../tools/getTenantHash" ;
55import { getAllOrganizationsQuery } from "../../utils/organization.utils" ;
@@ -396,7 +396,7 @@ export const createAutomationWorker = () => {
396396 throw error ;
397397 }
398398 } ,
399- { connection : redisClient , concurrency : 10 }
399+ { connection : { url : REDIS_URL } , concurrency : 10 }
400400 ) ;
401401 automationWorker . on ( "completed" , ( job ) => {
402402 console . log ( `Job ${ job . id } of type ${ job . name } has been completed` ) ;
Original file line number Diff line number Diff line change 11import { Queue } from "bullmq" ;
2- import redisClient from "../../database/redis" ;
2+ import { REDIS_URL } from "../../database/redis" ;
33import logger from "../../utils/logger/fileLogger" ;
44
55export const mlflowSyncQueue = new Queue ( "mlflow-sync" , {
6- connection : redisClient ,
6+ connection : { url : REDIS_URL } ,
77} ) ;
88
99const SYNC_JOB_NAME = "mlflow-sync-all-orgs" ;
Original file line number Diff line number Diff line change 11import { Job , Worker } from "bullmq" ;
2- import redisClient from "../../database/redis" ;
2+ import { REDIS_URL } from "../../database/redis" ;
33import logger from "../../utils/logger/fileLogger" ;
44import { MLFlowService } from "../../src/services/mlflow.service" ;
55import { ValidationException } from "../../domain.layer/exceptions/custom.exception" ;
@@ -146,7 +146,7 @@ export const createMlflowSyncWorker = () => {
146146 return [ ] ;
147147 } ,
148148 {
149- connection : redisClient ,
149+ connection : { url : REDIS_URL } ,
150150 concurrency : 1 ,
151151 }
152152 ) ;
Original file line number Diff line number Diff line change 11import { Queue } from "bullmq" ;
22import logger from "../../utils/logger/fileLogger" ;
3- import redisClient from "../../database/redis"
3+ import { REDIS_URL } from "../../database/redis"
44
55// Create a new queue (connected to Redis using environment variable)
66export const notificationQueue = new Queue ( "slack-notifications" , {
7- connection : redisClient ,
7+ connection : { url : REDIS_URL } ,
88} ) ;
99
1010export async function scheduleDailyNotification ( ) {
Original file line number Diff line number Diff line change 11import { Worker , Job } from "bullmq" ;
2- import redisClient from "../../database/redis" ;
2+ import { REDIS_URL } from "../../database/redis" ;
33
44import { sendPolicyDueSoonNotification } from "./policyDueSoonNotification" ;
55
@@ -14,7 +14,7 @@ export const createNotificationWorker = () => {
1414 throw new Error ( `Unknown job type: ${ job . data . type } ` ) ;
1515 }
1616 } ,
17- { connection : redisClient }
17+ { connection : { url : REDIS_URL } }
1818 ) ;
1919
2020 worker . on ( "completed" , ( _job ) => {
You can’t perform that action at this time.
0 commit comments