24 lines
618 B
JavaScript
24 lines
618 B
JavaScript
const path = require("path");
|
|
require("dotenv").config({
|
|
path: path.resolve(process.cwd(), `.env.${process.env.NODE_ENV || "development"}`)
|
|
});
|
|
const Queue = require("better-queue");
|
|
|
|
const logger = require("../../utils/logger");
|
|
|
|
const notificationsEmailQueue = () =>
|
|
new Queue(
|
|
(taskIds, cb) => {
|
|
logger.log("Processing Notification Emails: ", "silly", null, null);
|
|
cb(null);
|
|
},
|
|
{
|
|
batchSize: 50,
|
|
batchDelay: 5000,
|
|
// The lower this is, the more likely we are to hit the rate limit.
|
|
batchDelayTimeout: 1000
|
|
}
|
|
);
|
|
|
|
module.exports = { notificationsEmailQueue };
|