floraison / fugit

time tools (cron, parsing, durations, ...) for Ruby, rufus-scheduler, and flor
MIT License
355 stars 29 forks source link

Have a hard stop in Cron#next_time (and #previous_time) #13

Closed jmettraux closed 5 years ago

jmettraux commented 5 years ago

As seen with @godfat in gh-11.

jmettraux commented 5 years ago

Duplicate of #10, I should release ASAP.

jmettraux commented 5 years ago

@godfat Would that suit you if I released fugit 1.1.7 immediately?

godfat commented 5 years ago

@jmettraux Thank you very much for the quick reactions! I didn't have time to look into how this was implemented yet, but my main concern is that next_time can potentially never stop. This is way more harmful than accepting an invalid cron because it's very easily to shut down a service with that (i.e. a DoS attack). I really hope the implementation can be done in a way that it's impossible to get into this situation.

We're not using fugit yet, so please take your time, and there's no need to release a new version immediately for us, but I think that's indeed a very critical fix which should be available to other users soon.

On the other hand, I will be hesitant to make the switch before I am sure fugit will always stop in a timely manner. I'll verify the implementation later. (e.g. a loop has a hard limit to stop and raise an error)

Thanks again!

jmettraux commented 5 years ago

@godfat

We are in sync, I was thinking about such a hard stop as I was waiting for the bus. I will implement it.

Best regards and thanks again.

godfat commented 5 years ago

Awesome, thank you!

jmettraux commented 5 years ago

Included in the 1.1.7 release. Many thanks.