I have a certain amount of global variable saved in the localfilesystem. I have seen that the variables are saved in .node-red/context/global/global.json, but there is something weird: not all the variables are in that file, and their state is not synchronized in real time. In other words, if a variable passes from state "true" to state "false", in that file it stays "true" for a while (about a minute), before changing state.
Is there some doc where I can study how this mechanism works?
Note that it only writes if a value has changed. If you monitor /var/log/syslog you will see that writing the context out at that rate will not be an issue unless you have a large amount of data.
indeed, I was looking at the syslog this morning, but didn’t find any entry related to saving context. Just starting/stopping flows while deploying...
I didn't mean there was anything related to context, just that there is continual background chatter there, making saving context every 30 seconds irrelevant, unless you have a very lightly loaded pi, in which case you don't need to worry anyway.
I just did ls -al /var/log/ on my main pi, which is a pi3 (B?) to see how much there is and realise that pihole is logging about 25MB/day and has been doing that for years on the same card without issue. I think I might look how to turn that down a bit though, it is a bit excessive.