Skip to content

Commit 9cf93f0

Browse files
committed
create notificationTrack when email job is added to queue
1 parent d46c52e commit 9cf93f0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/queue.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ const addJobToEmailQueue = async (data) => {
4444
logger.info('adding email to queue: ', data);
4545
const job = await emailQueue.add('job', data, EMAIL_REMOVE_CONFIG);
4646
try {
47-
await db.models.notificationTrack.findOrCreate({where: {
47+
await db.models.notificationTrack.create({
4848
notificationId: data.notifId,
4949
jobId: job.id,
5050
recipient: data.mailOptions.to,
5151
reason: data.eventType,
5252
outcome: 'created',
53-
}});
53+
});
5454
} catch (error) {
5555
logger.error(`Unable to create notification track ${error}`);
5656
throw new Error(error);

0 commit comments

Comments
 (0)