apply prettier on all files

This commit is contained in:
Bilal Catic
2019-09-05 11:14:54 +02:00
parent 719cf4d8f9
commit 60e618fd22
45 changed files with 1749 additions and 1621 deletions

View File

@@ -1,29 +1,34 @@
const db = require("../models/index");
const { allMarketAlerts } = require('../helpers/db/dbHelper');
const { createMarketAlertEmailTemplate, sendBulkEmail } = require('../helpers/awsEmail');
const { allMarketAlerts } = require("../helpers/db/dbHelper");
const {
createMarketAlertEmailTemplate,
sendBulkEmail
} = require("../helpers/awsEmail");
async function processNotifications() {
try {
const marketAlerts = await allMarketAlerts(false, false);
console.log(marketAlerts.length)
await createMarketAlertEmailTemplate();
if (marketAlerts.length > 0) {
console.log("NOTIFICATION SERVICE: Number of new alerts: " + marketAlerts.length)
await sendBulkEmail(marketAlerts);
} else {
console.log("NOTIFICATION SERVICE: No new alerts");
}
await db.MarketAlert.update(
{ notified: true }, /* set attributes' value */
{ where: { notified: false } } /* where criteria */
);
} catch (e) {
console.log("NOTIFICATION SERVICE: could not send notifications reason: ", e);
try {
const marketAlerts = await allMarketAlerts(false, false);
console.log(marketAlerts.length);
await createMarketAlertEmailTemplate();
if (marketAlerts.length > 0) {
console.log(
"NOTIFICATION SERVICE: Number of new alerts: " + marketAlerts.length
);
await sendBulkEmail(marketAlerts);
} else {
console.log("NOTIFICATION SERVICE: No new alerts");
}
await db.MarketAlert.update(
{ notified: true } /* set attributes' value */,
{ where: { notified: false } } /* where criteria */
);
} catch (e) {
console.log(
"NOTIFICATION SERVICE: could not send notifications reason: ",
e
);
}
}
module.exports = processNotifications;