feature/IO-3492-FCM-Queue-For-Notifications: Implement FCM queue and worker for notifications
This commit is contained in:
10
server.js
10
server.js
@@ -38,6 +38,7 @@ const { registerCleanupTask, initializeCleanupManager } = require("./server/util
|
||||
|
||||
const { loadEmailQueue } = require("./server/notifications/queues/emailQueue");
|
||||
const { loadAppQueue } = require("./server/notifications/queues/appQueue");
|
||||
const { loadFcmQueue } = require("./server/notifications/queues/fcmQueue");
|
||||
|
||||
const CLUSTER_RETRY_BASE_DELAY = 100;
|
||||
const CLUSTER_RETRY_MAX_DELAY = 5000;
|
||||
@@ -355,9 +356,10 @@ const loadQueues = async ({ pubClient, logger, redisHelpers, ioRedis }) => {
|
||||
const queueSettings = { pubClient, logger, redisHelpers, ioRedis };
|
||||
|
||||
// Assuming loadEmailQueue and loadAppQueue return Promises
|
||||
const [notificationsEmailsQueue, notificationsAppQueue] = await Promise.all([
|
||||
const [notificationsEmailsQueue, notificationsAppQueue, notificationsFcmQueue] = await Promise.all([
|
||||
loadEmailQueue(queueSettings),
|
||||
loadAppQueue(queueSettings)
|
||||
loadAppQueue(queueSettings),
|
||||
loadFcmQueue(queueSettings)
|
||||
]);
|
||||
|
||||
// Add error listeners or other setup for queues if needed
|
||||
@@ -368,6 +370,10 @@ const loadQueues = async ({ pubClient, logger, redisHelpers, ioRedis }) => {
|
||||
notificationsAppQueue.on("error", (error) => {
|
||||
logger.log(`Error in notificationsAppQueue: ${error}`, "ERROR", "queue", "api", null, { error: error?.message });
|
||||
});
|
||||
|
||||
notificationsFcmQueue.on("error", (error) => {
|
||||
logger.log(`Error in notificationsFCMQueue: ${error}`, "ERROR", "queue", "api", null, { error: error?.message });
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user