fix interval
This commit is contained in:
parent
02d9cc1e76
commit
231805f373
@ -19,9 +19,9 @@ export class DynDnsBot{
|
|||||||
}
|
}
|
||||||
setInterval(seconds = this.config.updateInterval, random = this.config.randomInterval){
|
setInterval(seconds = this.config.updateInterval, random = this.config.randomInterval){
|
||||||
let handler = random
|
let handler = random
|
||||||
? (callback) => setTimeout(callback, Math.random()*seconds*1000)
|
? () => setTimeout(()=>this.update(), Math.random()*seconds*1000)
|
||||||
: (callback) => callback();
|
: () => this.update();
|
||||||
this.interval = setInterval(handler(()=>this.update()), seconds*1000);
|
this.interval = setInterval(handler, seconds*1000);
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
async getIp(){
|
async getIp(){
|
||||||
|
Loading…
Reference in New Issue
Block a user