feature/IO-3096-GlobalNotifications - Checkpoint, Builders

This commit is contained in:
Dave Richer
2025-02-18 12:57:54 -05:00
parent c214ed1dfb
commit adb15a4748
7 changed files with 149 additions and 138 deletions

View File

@@ -5,12 +5,19 @@ let appQueue;
const loadAppQueue = async ({ pubClient, logger, redisHelpers }) => {
if (!appQueue) {
logger.logger.info("Initializing Notifications App Queue");
appQueue = await new Queue("notificationsApp", { connection: pubClient, prefix: "{BULLMQ}" });
appQueue = new Queue("notificationsApp", {
connection: pubClient,
prefix: "{BULLMQ}"
});
}
return appQueue;
};
const getQueue = () => (!appQueue ? loadAppQueue : appQueue);
const getQueue = () => {
if (!appQueue) {
throw new Error("App queue not initialized. Ensure loadAppQueue is called during bootstrap.");
}
return appQueue;
};
module.exports = getQueue;
module.exports = { loadAppQueue, getQueue };