floraison / fugit

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

Specify which sidekiq-cron version is available #102

Closed ozachun closed 2 months ago

ozachun commented 2 months ago

Issue description

Stated in https://github.com/floraison/fugit?tab=readme-ov-file 「Related projects - Similar, sometimes overlapping projects」of sidekiq-cron - recent versions of Sidekiq-Cron use fugit to parse cron strings

In the above description, it says that it is available in the recent versions of Sidekiq-Corn, but from which version is it available? Not stated.

How to reproduce

version Booted Rails 7.0.7, Running in ruby 3.2.2, Sidekiq Pro 5.5.8 / Sidekiq Enterprise 2.5.3

The simplest piece of code that reproduces the issue, for example:

cron.register('07 3,11,15 *', 'CreateDfplusCsvWorker', 'args' => [])

config.periodic do |cron|
  cron.register('0 5 * * mon#1', SampleWorker', 'args' => [])
end

bundle exec rails c

>  SampleWorker.perform_async()

Expected behaviour

It should be stated from which sidekiq-corn version it is available.

jmettraux commented 2 months ago

It should be stated from which sidekiq-corn version it is available.

I don't know about sidekiq-corn, but any version of Sidekiq-Cron from 2019 or younger should be OK. So >= 1.1.0

Thanks for your understanding. Everything clear?

jmettraux commented 2 months ago

In Sidekiq-Cron's CHANGELOG.md, it is specified that it uses fugit since version 1.0.0. According to the list of Sidekiq-Cron versions, version 1.0.0 is available since 2018-07-09.

jmettraux commented 2 months ago

I consider your issue fixed. I stated in the README.md what version of Sidekiq-Cron started using fugit directly instead of rufus-scheduler. You said "not stated" as the issue, it is now stated. Issue closed.

Feel free to open a new issue if you spot anything else.

Please understand that I do not own a license of Sidekiq-Pro, so I cannot test it for you.

Please also understand that I am developing this library on my spare time mostly, I cannot give you support for free for libraries that I did not develop. If you can prove that you have an issue with fugit, and you can describe it so that I can reproduce it, I will do my best to fix it.

Best regards.

jmettraux commented 2 months ago

And

config.periodic do |cron|
  cron.register('0 5 * * mon#1', SampleWorker', 'args' => [])
end

is not valid Ruby code, it should be

config.periodic do |cron|
  cron.register('0 5 * * mon#1', 'SampleWorker', 'args' => [])
end

or

config.periodic do |cron|
  cron.register('0 5 * * mon#1', SampleWorker, 'args' => [])
end
ozachun commented 1 month ago

Thank you for your response to the correction. The issue has been resolved. Thank you!