improvement: move sentry config to .env

This commit is contained in:
canove
2020-08-13 17:58:37 -03:00
parent 7850a0cdfa
commit 5b429bda87
4 changed files with 25 additions and 15 deletions

View File

@@ -1,3 +1,5 @@
const Sentry = require("@sentry/node");
const Whatsapp = require("../models/Whatsapp");
const wbotMessageListener = require("./wbotMessageListener");
@@ -19,6 +21,7 @@ const wbotMonitor = () => {
try {
await Whatsapp.update({ battery, plugged }, { where: { id: 1 } });
} catch (err) {
Sentry.captureException(err);
console.log(err);
}
@@ -34,7 +37,10 @@ const wbotMonitor = () => {
wbotMessageListener();
wbotMonitor();
})
.catch(err => console.log(err)),
.catch(err => {
Sentry.captureException(err);
console.log(err);
}),
2000
);
});
@@ -43,6 +49,7 @@ const wbotMonitor = () => {
// wbot.resetState();
// }, 20000);
} catch (err) {
Sentry.captureException(err);
console.log(err);
}
};