From beaca3e61c465ab42701771a61d337558dcb7901 Mon Sep 17 00:00:00 2001 From: adb Date: Mon, 12 Apr 2021 22:40:46 +0200 Subject: [PATCH] fix refreshZone --- DynDnsBot.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DynDnsBot.js b/DynDnsBot.js index 7cb7df4..71bea3d 100644 --- a/DynDnsBot.js +++ b/DynDnsBot.js @@ -13,11 +13,11 @@ export class DynDnsBot{ if (newIp === this.lastIp) return; this.lastIp = newIp; Object.keys(this.config.records).forEach(domain => { - this.config.records[domain].forEach(record => { + Promise.all(this.config.records[domain].map(async record => { record.target = newIp; - this.dns.updateRecord(record, domain).then(()=>this.dns.refreshZone(domain)); - }) - }); + await this.dns.updateRecord(record, domain); + })).then(() => this.dns.refreshZone(domain)); + }) } setInterval(seconds = this.config.updateInterval, random = this.config.randomInterval){ let handler = random