feat: introduce Sentry

This commit is contained in:
Ali BARIN
2023-03-10 18:53:10 +00:00
parent 2c18667ffd
commit 4d90df9d9a
19 changed files with 197 additions and 13 deletions

View File

@@ -1,4 +1,6 @@
import { Worker } from 'bullmq';
import * as Sentry from '../helpers/sentry.ee';
import redisConfig from '../config/redis';
import logger from '../helpers/logger';
import User from '../models/user';
@@ -37,6 +39,12 @@ worker.on('failed', (job, err) => {
logger.info(
`JOB ID: ${job.id} - The user with the ID of '${job.data.id}' has failed to be deleted! ${err.message}`
);
Sentry.captureException(err, {
extra: {
jobId: job.id,
}
});
});
process.on('SIGTERM', async () => {