Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resque-scheduler (4.3.1) bug with rufus-scheduler (3.5.0) #649

Open
Nkadze opened this issue Jul 19, 2018 · 7 comments
Open

resque-scheduler (4.3.1) bug with rufus-scheduler (3.5.0) #649

Nkadze opened this issue Jul 19, 2018 · 7 comments

Comments

@Nkadze
Copy link

Nkadze commented Jul 19, 2018

Hi,
This happens when it tries to start schedule from scheduler file,

NoMethodError: undefined method `next_time' for nil:NilClass
/app/vendor/bundle/ruby/2.3.0/gems/rufus-scheduler-3.5.0/lib/rufus/scheduler/jobs.rb:640:in `next_time_from'

cron type:

my_job_name:
  cron:  '/15 * * * *' # every 15 minutes
  queue: queue_name
  class: ActiveJob::QueueAdapters::ResqueAdapter::JobWrapper
  args:
    job_class: JobClassName
    queue_name: queue_name
  description: "This job runs every 15 minutes"

when I locked rufus-scheduler '~> 3.4.2' in gemfile, it was solved

Thanks,
Niko

@anvox
Copy link

anvox commented Aug 2, 2018

Same for us, ::Fugit::Cron.parse(cronline) in rufus-scheduler 3.5.0 is unable to parse cronline with timezone, like 0 0 * * 1 Etc/GMT-12. Look like a big change in behavior compare to CronLine.new(cronline) in rufus-scheduler 3.4.0

@jweir
Copy link
Contributor

jweir commented Aug 11, 2018

Related has anyone confirmed if * * * * * or * * * * * * works as a job never being scheduled? Our jobs which were to never get scheduled were firing every second. Just rolled back and will investigate more later.

@tmedford
Copy link

Has anyone figured this out?

@mcphailtom
Copy link

mcphailtom commented Apr 15, 2019

still seems to be an issue, I've just bumped into this with rufus-scheduler 3.5.2

@jeremy
Copy link
Contributor

jeremy commented Apr 15, 2019

Sounds like that should've been a rufus-scheduler 4.0.0 release. As a workaround, resque-scheduler 4.4.1 could require rufus-scheduler ~> 3.2, < 3.5 and resque-scheduler 5.0.0 would use rufus-scheduler ~> 3.5.

But that may break those who've already upgraded to rufus-scheduler 3.5+ and changed their cron lines…

@jeremy
Copy link
Contributor

jeremy commented Apr 15, 2019

Regarding the specific cases above, it appears the parser just got stricter. But the exception is misleading.

'/15 * * * *' # every 15 minutes

Nonstandard syntax. Should be */15 * * * *

* * * * * or * * * * * * works as a job never being scheduled?

That doesn't work. It means run every minute

Think you'll need to omit the schedule rather than using cron syntax to not run it.

@jmettraux
Copy link

jmettraux commented Apr 21, 2019

Released fugit 1.2.0. It accepts the non-standard "/15 * * * *".

Released rufus-scheduler 3.6.0 which fails on invalid cron strings, with a better error message.

Fugit is the parsing library used by rufus-scheduler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants