Fix to 'recent errors' check

This commit is contained in:
Dragory 2019-01-13 18:01:28 +02:00
parent 8de31844d5
commit 7417e34e00

View file

@ -10,7 +10,7 @@ require("dotenv").config();
let recentErrors = 0;
const RECENT_ERROR_EXIT_THRESHOLD = 5;
setInterval(() => recentErrors--, 2500);
setInterval(() => (recentErrors = Math.max(0, recentErrors - 1)), 2500);
process.on("unhandledRejection", (reason, p) => {
console.error(reason);