-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retain schedules after restart #11
Comments
Hi, That is a concern! To be clear,
Some questions to help me help you if you dont mind...
I am eager to fix this if its a bug. Thanks for feedback. |
One more thing - your title says "Retain schedules after restart" On the latest version (V1+) there is a new feature "Persist Dynamic Schedules" |
Hi Steve, To sum up:
My interpretation was that I was somehow mixing the dynamic setting of the node (I'm indeed injecting something) with the "static" operation (my schedules are written in the node). I'll come back to you if I find the same problems with the latest version. I conclude thanking you for the node. I really appreciate the flexibility it allows! Great idea all the best Pietro |
Ah so let me see if I understand this correctly.
That would be the expected behaviour because the nodes static settings are re-loaded on a reboot. Is my summary correct? 1 solution could be...
If you need help on that I can assist. Please let me know either way. |
Hi Steve,
So far so good
If I do like that the CRON node somehow freezes ... it is now telling to me that it will restart ten minutes ago ... From your message, I understand that a possible workaround could be to set dynamic schedules and retain them after reboot. But I find more "clean" to rely on static schedules and simply enable/disable them in a dynamic way. I'm attaching here my test flow (... so you will discover that I'm doing some stupid error ... ;-)) Many thanks for your time! Pietro [{"id":"9da5cf6c.f75a7","type":"cronplus","z":"698357b1.93c218","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"start","topic":"start","payloadType":"str","payload":"on","expressionType":"cron","expression":"0 10 23 * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"stop","topic":"stop","payloadType":"str","payload":"off","expressionType":"cron","expression":"0 15 23 * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":640,"y":740,"wires":[["624510bb.2c239"]]},{"id":"a44ce1d7.1a3dd","type":"inject","z":"698357b1.93c218","name":"stop all","topic":"","payload":"{"command":"stop-all"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":350,"y":720,"wires":[["9da5cf6c.f75a7","18347cec.6fe003"]]},{"id":"18347cec.6fe003","type":"change","z":"698357b1.93c218","name":"","rules":[{"t":"set","p":"test","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":860,"wires":[[]]},{"id":"c2d2fea5.c8a94","type":"inject","z":"698357b1.93c218","name":"","topic":"","payload":"test","payloadType":"global","repeat":"","crontab":"","once":true,"onceDelay":"1","x":210,"y":640,"wires":[["9da5cf6c.f75a7"]]},{"id":"703ed550.31a50c","type":"inject","z":"698357b1.93c218","name":"start all","topic":"","payload":"{"command":"start-all"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":350,"y":760,"wires":[["9da5cf6c.f75a7","18347cec.6fe003"]]},{"id":"624510bb.2c239","type":"debug","z":"698357b1.93c218","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":970,"y":760,"wires":[]}] |
Ah, if I manually re-inject a stop-start sequence the CRON node is back in its expected working state |
Yes, that is one way (see V1 in image) however unless you enable persistent context Global is reset when node-red restarts. So I did 2 demos of how you can handle this... V1 uses a contrib node that saves values to FILE for you. I use this node often as its simple and effective. V2 uses fully dynamic mode - i.e. I add / remove the schedules with persistence enabled. The demo flow...
|
Hi Steve,
Let me know what you think! all the best Pietro |
Hi @pietrofranceschi - I have found the issue and "contained it" for now (I have raised an issue on an underlying library). Can you please update to V1.0.6 and let me know 🤞 Thanks for your patience and support. Steve. |
Dear Steve, Pietro |
Dear Steve,
first of all many thanks for the nice piece of code!
I've some issues with my schedules when node-red restarts after a power cut or a system restart.
I've been setting my schedules inside the node, but after a system restart they do not run anymore even if they appear normally inside the node.
Am I missing something?
all the best
Pietro
The text was updated successfully, but these errors were encountered: