fix interval

This commit is contained in:
adb 2021-04-11 17:42:09 +02:00
parent 02d9cc1e76
commit 231805f373

View File

@ -19,9 +19,9 @@ export class DynDnsBot{
}
setInterval(seconds = this.config.updateInterval, random = this.config.randomInterval){
let handler = random
? (callback) => setTimeout(callback, Math.random()*seconds*1000)
: (callback) => callback();
this.interval = setInterval(handler(()=>this.update()), seconds*1000);
? () => setTimeout(()=>this.update(), Math.random()*seconds*1000)
: () => this.update();
this.interval = setInterval(handler, seconds*1000);
this.update();
}
async getIp(){