feat: Convert all queues folder to js files

This commit is contained in:
Faruk AYDIN
2023-12-28 13:55:28 +01:00
parent 7bccbc9471
commit cbe3db8187
6 changed files with 6 additions and 6 deletions

View File

@@ -0,0 +1,25 @@
import process from 'process';
import { Queue } from 'bullmq';
import redisConfig from '../config/redis';
import logger from '../helpers/logger';
const CONNECTION_REFUSED = 'ECONNREFUSED';
const redisConnection = {
connection: redisConfig,
};
const emailQueue = new Queue('email', redisConnection);
process.on('SIGTERM', async () => {
await emailQueue.close();
});
emailQueue.on('error', (err) => {
if (err.code === CONNECTION_REFUSED) {
logger.error('Make sure you have installed Redis and it is running.', err);
process.exit();
}
});
export default emailQueue;