Skip to content

Commit

Permalink
updates #3 | adds: create and update fields for mails, update timeout…
Browse files Browse the repository at this point in the history
… to 5 minutes
  • Loading branch information
imsheth committed Jul 30, 2020
1 parent 77dc2dc commit 3a19f03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion consumer/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const MongoClient = require('mongodb').MongoClient;
const NotificationConfig = require('./configurations/configuration.json');
const NOTIFICATION_STATUSES = NotificationConfig.statuses;
const NOTIFICATION_ENABLED_FLAGS = NotificationConfig.enabled_flags;
let TIMEOUT = 1000;
let TIMEOUT = 1000 * 60 * 5;

// Processing the notifications based on their type and trigger_event
const typeBasedNotificationProcessing = async (notification) => {
Expand Down
4 changes: 4 additions & 0 deletions consumer/classes/notificationMail.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ notificationMail.prototype = {
newGeneratedMail.service_response = null;
newGeneratedMail.try_count = 0;

const currentTimestamp = new Date();
newGeneratedMail.db_created_at = currentTimestamp.getTime();
newGeneratedMail.db_updated_at = currentTimestamp.getTime();

generatedMails.push(newGeneratedMail);
});

Expand Down

0 comments on commit 3a19f03

Please sign in to comment.