Skip to content

Commit

Permalink
[AMR-99] fix: this.connect is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
N0chteil committed Oct 22, 2023
1 parent d44c805 commit e3fe04a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/managers/watchdog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export class WatchDog {
}

async init() {
const that = this;

if (this.watchdogUpdating) {
log.info("[WatchDog]", "WatchDog is updating");

Expand All @@ -44,20 +46,20 @@ export class WatchDog {
if (WatchDogDetails("status")) {
log.info("[WatchDog]", "WatchDog is installed");

if (await WatchDogDetails("running")) this.connect();
if (await WatchDogDetails("running")) that.connect();
else {
WatchDogState(true);

setTimeout(async () => {
if (await WatchDogDetails("running")) this.connect();
else this.init();
if (await WatchDogDetails("running")) that.connect();
else that.init();
}, 2500);
}
} else {
log.info("[WatchDog]", "WatchDog is not installed");

if (config.get("watchdog.autoUpdates")) {
setTimeout(() => this.init(), 3000);
setTimeout(that.init, 3000);

return;
}
Expand Down

0 comments on commit e3fe04a

Please sign in to comment.