Skip to content

Commit 956135f

Browse files
authored
Merge pull request #3090 from bluewave-labs/develop
Merge develop into master (Jan 15)
2 parents 59d3c2c + 384eee0 commit 956135f

File tree

7 files changed

+15
-13
lines changed

7 files changed

+15
-13
lines changed

Servers/database/redis.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import 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

Servers/services/automations/automationProducer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Queue } from "bullmq";
2-
import redisClient from "../../database/redis"
2+
import { REDIS_URL } from "../../database/redis"
33
import logger from "../../utils/logger/fileLogger";
44

55
// Create a new queue (connected to Redis using environment variable)
66
export const automationQueue = new Queue("automation-actions", {
7-
connection: redisClient
7+
connection: { url: REDIS_URL }
88
});
99

1010
export async function enqueueAutomationAction(

Servers/services/automations/automationWorker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Worker, Job } from "bullmq";
2-
import redisClient from "../../database/redis";
2+
import { REDIS_URL } from "../../database/redis";
33
import sendEmail from "./actions/sendEmail";
44
import { getTenantHash } from "../../tools/getTenantHash";
55
import { 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`);

Servers/services/mlflow/mlflowSyncProducer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Queue } from "bullmq";
2-
import redisClient from "../../database/redis";
2+
import { REDIS_URL } from "../../database/redis";
33
import logger from "../../utils/logger/fileLogger";
44

55
export const mlflowSyncQueue = new Queue("mlflow-sync", {
6-
connection: redisClient,
6+
connection: { url: REDIS_URL },
77
});
88

99
const SYNC_JOB_NAME = "mlflow-sync-all-orgs";

Servers/services/mlflow/mlflowSyncWorker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Job, Worker } from "bullmq";
2-
import redisClient from "../../database/redis";
2+
import { REDIS_URL } from "../../database/redis";
33
import logger from "../../utils/logger/fileLogger";
44
import { MLFlowService } from "../../src/services/mlflow.service";
55
import { 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
);

Servers/services/slack/slackProducer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Queue } from "bullmq";
22
import 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)
66
export const notificationQueue = new Queue("slack-notifications", {
7-
connection: redisClient,
7+
connection: { url: REDIS_URL },
88
});
99

1010
export async function scheduleDailyNotification() {

Servers/services/slack/slackWorker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Worker, Job } from "bullmq";
2-
import redisClient from "../../database/redis";
2+
import { REDIS_URL } from "../../database/redis";
33

44
import { 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) => {

0 commit comments

Comments
 (0)