From 68d4b669725b7e4b16aa1a7e776d6bb2dfb263ad Mon Sep 17 00:00:00 2001 From: ElevenNotes Date: Thu, 1 Feb 2024 11:20:14 +0100 Subject: [PATCH] dynamic node reloading --- rootfs/labels/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rootfs/labels/main.js b/rootfs/labels/main.js index 7eaa206..8ef734d 100644 --- a/rootfs/labels/main.js +++ b/rootfs/labels/main.js @@ -35,7 +35,7 @@ class Labels{ this.#tls.crt = fs.readFileSync(this.#config?.tls?.crt || this.#defaults.tls.crt); this.#tls.key = fs.readFileSync(this.#config?.tls?.key || this.#defaults.tls.key); - this.#nodes(true); + this.#loadNodes(true); if(this.#config?.webhook?.url){ this.#config.webhook.headers = {'Content-Type':'application/json'}; @@ -47,14 +47,14 @@ class Labels{ } } - async #nodes(init){ + async #loadNodes(init){ if(!this.#intervals.nodes && (this.#config?.interval || this.#defaults.interval) > 0){ this.#intervals.nodes = true; setInterval(async() => { if(!this.#loops.nodes){ this.#loops.nodes = true; try{ - await this.#nodes(false); + await this.#loadNodes(false); }catch(e){ elevenLogJSON('error', JSON.stringify({nodes:{exception:e.toString()}})); }finally{