Read the statement by Michael Teeuw here.
What other factors are affecting the updateInterval?
-
I’m running with a config
updateInterval
set to 60 seconds, but for some reason it get’s updated every 30 seconds! Any idea what’s going on?Here is the only place using this:
socketNotificationReceived: function (notification, payload) { if (notification === "START_RADAR") { //console.log("Received START_RADAR"); this.config = payload; this.radarPing(); setInterval(() => { this.radarPing(); }, this.config.updateInterval * 1000 ); } }
I should mention that I was measuring on the second server instance. Can it be that the time interval doubles/halfs, for every client connected?
-
Yep, just confirmed. Running 1 instance with
serveronly
gives the correct updateInterval. Connecting more, messes that up. How would you guys deal with this? -
@E3V3A every client instance is connecting to the same nodehelper, so what some people did is having a start boolean variable so they can check if the nodehelper already initialised e.g.
https://github.com/paviro/MMM-Wunderlist/blob/master/node_helper.js#L19
https://github.com/paviro/MMM-Wunderlist/blob/master/node_helper.js#L94
https://github.com/paviro/MMM-Wunderlist/blob/master/node_helper.js#L106 -
@strawberry-3.141 That worked like charm! Spot on. Thank you! Just have to remember for long timers, the following clients need to wait for the first to timeout, before getting any data.
-
@E3V3A you can store the data in a variable in the node helper, every time someone connects and your start flag is already set you just send him the data from your variable
-
@strawberry-3.141 Great idea! Do you have any code examples for doing this? (I’m still a JS dummy.)
-
@E3V3A here is your example https://github.com/E3V3A/MMM-FlightsAbove/pull/16
-
@strawberry-3.141 Thanks a lot! PR merged.