Steve-Mcl/node-red-contrib-cron-plus

'Persist Dynamic Schedules' doesn't persist paused state

Closed this issue · 6 comments

Hi there,

When re-deploying a flow although the schedules are restored, the paused state is lost.

Does exportTask() need to set the isRunning property perhaps?

Thanks for this great node by the way!

Hi. Restoring state is something I knew would be asked for at some point. The issue is whether to make it optional or default. Any thoughts on this?

Thanks! If you want to persist the state of the tasks at all, I can't think of a reason for not persisting the whole state (including whether things have been paused or not).

If someone pauses (or stops) a schedule / job, then they want it to remain that way until they restart it. I see that the usefulness of pausing a schedule / job is that you don't have to think about how to describe that job if you want to re-enable it later, but you absolutely don't want it starting up again unexpectedly if your system is rebooted etc.

In short, I think that persisting the paused state should be default behaviour

I agree with having paused state persisted by default. Thank you for this node!!!

I would also really want this feature!
As for making it default: that would potentially break existing installations that rely on that behaviour, so it is probably best to add an option (next to 'Persist dynamic schedules) to also persist/load state, with an default value of 'disabled'.

Added in v2.0.0 released today :)