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

Calling configure breaks everything #16

Open
cjbottaro opened this issue Jul 6, 2017 · 1 comment
Open

Calling configure breaks everything #16

cjbottaro opened this issue Jul 6, 2017 · 1 comment

Comments

@cjbottaro
Copy link

Hi.

This code doesn't work:

module Clockwork

  configure do |config|
    config[:sleep_timeout] = 1
    config[:logger] = Logger.new(STDOUT)
    config[:tz] = "CST"
    config[:max_threads] = 10
    config[:thread] = true
  end

  handler { |job| puts job.inspect }

  every(1.second, "frequent_hob")
end

But if you comment out the configure block, then everything runs fine.

Thanks.

@jwoertink
Copy link

jwoertink commented Feb 15, 2018

I'm getting the same after upgrading to 2.0 (and rails 5)

NoMethodError: undefined method `configure' for Clockwork:Module

EDIT: Turns out that (at least in rails 5) if you have your clockwork file named clockwork.rb it breaks. I renamed the file to schedule.rb and it all works fine. Maybe something with how rails autoloads now?

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

2 participants