I hope we can start having a look at it some time next week.
Original Message:
Sent: 06-10-2025 10:14
From: Johan Cantens
Subject: Disabling live reload config does not unwatch config file
Hello Jerome
Thank you for the update! is it possible to get a date ? Because this has quit some impact for us.
kind regards,
Johan
| | | Johan Cantens | | Senior Application Developer | | | | | | | Tiensesteenweg 168, bus 401 blok C, 3800 Sint-Truiden | | | | | | | | | |
Original Message:
Sent: 6/10/2025 9:57:00 AM
From: Jerome Saint-Marc
Subject: RE: Disabling live reload config does not unwatch config file
Hello,
Not yet. We are working on a round of features and issues. We should take a look at this one in the next round.
Regards,
------------------------------
Jerome Saint-Marc
Senior Development Support Engineer
------------------------------
Original Message:
Sent: 06-10-2025 06:54
From: Johan Cantens
Subject: Disabling live reload config does not unwatch config file
Hi Jerome
Do you have an update?
Regards, Johan
------------------------------
Johan Cantens
Independant Genesys Consultant & Data Architect
Original Message:
Sent: 05-22-2025 08:25
From: Jerome Saint-Marc
Subject: Disabling live reload config does not unwatch config file
Thank you. I'll bring this to the attention of the SDK team and will update this post when I have some news.
Regards,
------------------------------
Jerome Saint-Marc
Senior Development Support Engineer
Original Message:
Sent: 05-22-2025 02:50
From: Johan Cantens
Subject: Disabling live reload config does not unwatch config file
If it helps, this is my untested code changes that I think should fix the problem.
If you want I could test it properly and create a pull request.
diff --git a/build/src/purecloud-platform-client-v2/configuration.js b/build/src/purecloud-platform-client-v2/configuration.jsindex 36fe69d6..3c77cd80 100644--- a/build/src/purecloud-platform-client-v2/configuration.js+++ b/build/src/purecloud-platform-client-v2/configuration.js@@ -29,7 +29,7 @@ class Configuration { } this.refresh_access_token = true; this.refresh_token_wait_max = 10;- this.live_reload_config = true;+ this._live_reload_config = true; this.host; this.environment; this.basePath;@@ -39,6 +39,7 @@ class Configuration { this.logger = new Logger(); this.setEnvironment(); this.liveLoadConfig();+ this.listener = undefined; } liveLoadConfig() {@@ -51,11 +52,19 @@ class Configuration { if (this.live_reload_config && this.live_reload_config === true) { try { const fs = require('fs');- fs.watchFile(this.configPath, { persistent: false }, (eventType, filename) => {++ // This could happen if config path changed via setConfigPath()+ // Unsubscribe to previous listener so we aren't listening to multiple files+ if (this.listener) {+ this.listener.close();+ }++ this.listener = fs.watchFile(this.configPath, { persistent: false }, (eventType, filename) => { this.updateConfigFromFile();- if (!this.live_reload_config) {- fs.unwatchFile(this.configPath);- }+ // No longer needed because will unsubscribe in setter of live_reload_config+ // if (!this.live_reload_config) {+ // fs.unwatchFile(this.configPath);+ // } }); } catch (err) { // do nothing@@ -67,6 +76,18 @@ class Configuration { this.configPath = ''; } + set live_reload_config(enabled) {+ this._live_reload_config = enabled;++ if (!enabled && this.listener) {+ this.listener.close();+ }+ }++ get live_reload_config() {+ return this._live_reload_config;+ }+ setConfigPath(path) { if (path && path !== this.configPath) { this.configPath = path;

------------------------------
Johan Cantens
Independant Genesys Consultant & Data Architect
Original Message:
Sent: 05-22-2025 02:27
From: Johan Cantens
Subject: Disabling live reload config does not unwatch config file
Hi,
No config file and no reload.
But in the current implementation of the library the default config file is automatically watched in the constructor of Configuration.
Currently I can only disable auto reload after Configuration is initialized.
So I should be able to either:
- Specify earlier that I don't want to auto reload
- Or the file already being watched with fs.watchFile should be unwatched/closed when I disable auto reload so there are no unused open listeners in the node process.
Regards,
------------------------------
Johan Cantens
Independant Genesys Consultant & Data Architect
Original Message:
Sent: 05-21-2025 13:20
From: Jerome Saint-Marc
Subject: Disabling live reload config does not unwatch config file
Hello,
Are you trying to load the config from a file and not have auto/live reload?
Or no config file and no reload?
Regards,
------------------------------
Jerome Saint-Marc
Senior Development Support Engineer