bytex
Topic Author
Posts: 2
Joined: 25 Oct 2022, 10:35

contextData on fileSystem

25 Oct 2022, 10:51

I have variables saved on context fileSystem.
https://nodered.org/docs/user-guide/context

I notice that if I restart the RevPi (sudo reboot) the variables are kept.
Conversely, if the device is turned off by removing the power supply, the variables are not maintained.

How can you overcome this problem?
 
User avatar
nicolaiB
KUNBUS
Posts: 714
Joined: 21 Jun 2018, 10:33
Answers: 1
Location: Berlin
Contact:

Re: contextData on fileSystem

25 Oct 2022, 11:11

Hi,

this is probably caused by the fact, that the context is not written to the storage. When the RevPi is being shutdown / rebooted NodeRed stops gracefully and writes everything to the disk. If you just powercycle the device NodeRed has no chance of writing the context to the disk.

From the NodeRed docs https://nodered.org/docs/api/context/st ... filesystem:
The flushInterval is provided to minimise wear on the underlying storage, such as on a Raspberry Pi’s SD card. Note that if Node-RED is unexpectedly killed, any data that has not yet been flushed will be lost.
Nicolai
 
bytex
Topic Author
Posts: 2
Joined: 25 Oct 2022, 10:35

Re: contextData on fileSystem

25 Oct 2022, 13:45

Thanks a lot, I did not know this feature.
Resolved.

Who is online

Users browsing this forum: No registered users and 1 guest