add node timeout

This commit is contained in:
ElevenNotes
2024-02-01 11:35:39 +01:00
parent 16ceb5a17a
commit 2b98936893
3 changed files with 8 additions and 2 deletions

View File

@@ -12,7 +12,9 @@ labels:
- 192.168.18.12
- 10.14.120.1
# reload labels.nodes every {n} seconds (0 = disabled)
interval: 60
interval: 0
# timeout in seconds for the connection to a Docker node
timeout: 2.5
rfc2136:
# only nsupdate on entries which are different (remove existing entry)
update-only: true

View File

@@ -18,6 +18,7 @@ class Labels{
#config = yaml.load(fs.readFileSync(`${process.env.APP_ROOT}/etc/config.yaml`, 'utf8'))?.labels;
#defaults = {
interval:0,
timeout:2.5,
tls:{
ca:`${process.env.APP_ROOT}/ssl/ca.crt`,
crt:`${process.env.APP_ROOT}/ssl/labels.crt`,
@@ -75,6 +76,7 @@ class Labels{
ca:this.#tls.ca,
cert:this.#tls.crt,
key:this.#tls.key,
timeout:(this.#config?.timeout || this.#defaults.timeout)*1000
});
this.#nodes[node].labels = {ping:false, firstConnect:init};
}