Browse Source

dead watchdog

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

11
tradebot.js

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

Loading…
Cancel
Save