floraison / fugit

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

Incorrect schedule in certain timezone when using hash cron extention #67

Closed phibid closed 2 years ago

phibid commented 2 years ago

Opening an issue here too after opening it in Gitlab, https://gitlab.com/gitlab-org/gitlab/-/issues/354513, as it seems that Fugit is being used in Gitlab for the cron process.

The use of the cron hash extension don't give the correct schedule in some timezone. For example, in UTC, 30 18 2#5 will correctly be scheduled the last Tuesday of this month, the 29th. However, in Paris timezone, it will be scheduled in 2 months, the last Tuesday of May, the 24th.

Not sure if this issue is coming from Fugit or from the implementation done by Gitlab, but if you think that you are not concerned by this bug, just feel free to close this issue.

jmettraux commented 2 years ago

Hello @phibid, what version of fugit is used by Gitlab?

Thanks in advance.

jmettraux commented 2 years ago

They're using fugit 1.2.1, https://gitlab.com/gitlab-org/gitlab/-/blob/master/Gemfile.lock#L436

jmettraux commented 2 years ago

@phibid thanks for reporting that.

I'm seeing the issue with fugit 1.2.1 and the current 1.5.3 pre.

Although it points at the fifth Tuesday of May for me, 2022-05-31 but not the 2022-05-24 you seem to be seeing.

I will attempt to fix that. Give me a few days.

phibid commented 2 years ago

Ah yes sorry, typo, last Tuesday of May being the "May 31, 2022 6:30pm GMT+0200", not the 24th

Thanks !

jmettraux commented 2 years ago

@phibid Please upgrade your et-orbi gem to 1.2.7 and try again. Tell me if it fixes the issue for you.

phibid commented 2 years ago

Thanks ! However I am not directly using Fugit, but through Gitlab. Let me add this info in the original Gitlab issue and see the progression on this. Thanks again, will keep you updated.

jmettraux commented 2 years ago

@phibid OK, I saw your added info on Gitlab, I will complement it there.

Closing the issue here. I am ready to re-open it if necessary.

Thanks again!