sidekiq-cron: Incompatible with newer versions of rufus-scheduler

This gem works with rufus-scheduler version 3.4.2 but does not work with version 3.5.0

While using version 3.5.0, attempting Sidekiq::Cron::Job.create calls returns false, and the job is not added.

My only guess to the cause is that according to the changelog, rufus-scheduler now uses fugit to parse durations and cronlines. I looked for instances of parse_time_string and parse_duration_string in this repository, and didn’t find any - so it doesn’t appear that their removal is playing a part here.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 23
  • Comments: 16 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I got around this by adding this to my Gemfile

gem 'rufus-scheduler', '~> 3.4.0'

+1 this is urgent

@brianstien Thanks a lot!

I submitted a pull request that aligns Sidekiq-cron on fugit (the parsing lib behind rufus-scheduler >= 3.5 instead of rufus-scheduler).

http://jmettraux.skepti.ch/20180515.html?t=rufus_scheduler_3_5_0_released

I just installed version 1.0.0 and it fixed the mentioned error for me

@jmettraux This problem is affecting us as well. I was able to track down the error you were looking for

jruby-9.1.12.0 :018 > j = ::Sidekiq::Cron::Job.new(:name => "foo", :cron => "* * * * *", :klass => "Foo", :queue => "foo")
 => #<Sidekiq::Cron::Job:0xd332ebc @active_job=false, @active_job_queue_name_prefix=nil, @active_job_queue_name_delimiter=nil, @klass="Foo", @args=[], @status="enabled", @last_enqueue_time=nil, @fetch_missing_args=true, @message={"queue"=>"foo", "class"=>"Foo", "args"=>[]}, @name="foo", @queue="foo", @queue_name_with_prefix="foo", @cron="* * * * *"> 
jruby-9.1.12.0 :019 > j.valid?
 => false 
jruby-9.1.12.0 :020 > j.errors
 => ["'cron' -> * * * * *: uninitialized constant Rufus::Scheduler::CronLine"]

Any news?

@lucascaton Yes, people are giving feedback and coming with suggestions at gh-202, gh-209, gh-210, and gh-213. Since it’s not related to “Incompatible with newer versions of rufus-scheduler” (this issue), the conversation is happening elsewhere.

Thanks 😃

Yet another reminder: https://bundler.io/v1.16/guides/updating_gems.html

Updating your dependency gem versions is something you do deliberately, with your back covered by your test suite. http://jmettraux.skepti.ch/20180601.html?t=Gemfile_lock&f=gh