From 231805f373d51d67b474506218c748cd96a5695f Mon Sep 17 00:00:00 2001 From: adb Date: Sun, 11 Apr 2021 17:42:09 +0200 Subject: [PATCH] fix interval --- DynDnsBot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DynDnsBot.js b/DynDnsBot.js index 629e7ec..76502e7 100644 --- a/DynDnsBot.js +++ b/DynDnsBot.js @@ -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(){