feature/IO-3096-GlobalNotifications - Checkpoint, BULLMQ!
This commit is contained in:
16
server/notifications/queues/appQueue.js
Normal file
16
server/notifications/queues/appQueue.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const { Queue } = require("bullmq");
|
||||
|
||||
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}" });
|
||||
}
|
||||
return appQueue;
|
||||
};
|
||||
|
||||
const getQueue = () => (!appQueue ? loadAppQueue : appQueue);
|
||||
|
||||
module.exports = getQueue;
|
||||
Reference in New Issue
Block a user