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

A flexible scheduler node for Node-RED (featuring full dynamic control, sunrise/sunset by location and Timezone support)
MIT License
45 stars 12 forks source link

'Persist Dynamic Schedules' doesn't persist paused state #49

Closed harmonic7 closed 1 year ago

harmonic7 commented 2 years ago

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!

Steve-Mcl commented 2 years ago

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?

harmonic7 commented 2 years ago

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.

harmonic7 commented 2 years ago

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

teq-dev commented 2 years ago

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

jmichiel commented 1 year ago

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'.

Steve-Mcl commented 1 year ago

Added in v2.0.0 released today :)