Hi there, I have a problem with a function node (or node-red generally?). I have built a counter that writes the value to a variable and sends it to a database. This worked fine until a system update (Linux Debian) in May. Since then I have the problem that the counter resets after about 86 - 87s and starts from 0. I have updated Node-Red to 3.1.1. and also updated Node.JS. There has been no improvement. I have replaced the input (sensor via MQTT) with an Inject Node and the error is still present.
Node-Red Version V3.1.1
Node.JS Version 20.10.0
[{"id":"619db2f9830dc47b","type":"tab","label":"Testbereich","disabled":false,"info":"","env":[]},{"id":"97bba11763229d69","type":"inject","z":"619db2f9830dc47b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":"1","topic":"","payload":"1","payloadType":"num","x":170,"y":140,"wires":[["d38c745f87e7e686"]]},{"id":"d38c745f87e7e686","type":"switch","z":"619db2f9830dc47b","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":220,"wires":[["3c7fdb3f63de5e72"],[]]},{"id":"3c7fdb3f63de5e72","type":"function","z":"619db2f9830dc47b","name":"CounterMa20x","func":"//Definiere Variablen und ziehe gespeicherten Wert\n// wenn kein Wert vorhanden dann Wert = 0\nvar counterMa20x = flow.get(\"counterMa20x\") || 0\n\n// addiere 1 zum Zählwert\ncounterMa20x ++\n\n//speichere den Zähler Wert in der flow Variable\nflow.set(\"counterMa20x\", counterMa20x)\n\n//ändere msg.payload zum Zählwert\nmsg.payload = counterMa20x\n\n//dividiere durch Anzahl der Impulse\nmsg.payload = msg.payload*0.1425/4;\n//msg.payload = msg.payload*(Math.PI)/4;\n\nmsg.payload = Number(msg.payload.toFixed(2));\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":220,"wires":[["2b9ff46fb78bcccf"]]},{"id":"2b9ff46fb78bcccf","type":"debug","z":"619db2f9830dc47b","name":"debug 8","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":860,"y":160,"wires":[]}]