Browse Source

dead watchdog

master
gsd 3 months ago
parent
commit
4d01e80019
  1. 11
      tradebot.js

11
tradebot.js

@ -67,6 +67,8 @@ function calculate(offer) {
return seconds > 0; return seconds > 0;
} }
let exit_counter = 0;
function setupClient() { function setupClient() {
const config = require("./auth_data/auth.json") const config = require("./auth_data/auth.json")
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
@ -115,8 +117,15 @@ function setupClient() {
///////////watchdog///////////// ///////////watchdog/////////////
setInterval(() => { setInterval(() => {
if (!client.steamID) {} if (!client.steamID) {
exit_counter++;
if (exit_counter >= 5) {
console.log(consoleTime(), "Connect is dead");
process.exit(2);
}
}
else { else {
exit_counter = 0;
if (process.env.ALIVE_PUSH) { if (process.env.ALIVE_PUSH) {
const inst = axios.create({httpsAgent: new https.Agent({rejectUnauthorized: false})}) const inst = axios.create({httpsAgent: new https.Agent({rejectUnauthorized: false})})
inst.get(process.env.ALIVE_PUSH).then(() => {}).catch(() => {}) inst.get(process.env.ALIVE_PUSH).then(() => {}).catch(() => {})

Loading…
Cancel
Save