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

ArgumentError when using wait or wait_until ActiveJob options #194

Closed
brennana opened this issue Apr 15, 2016 · 2 comments
Closed

ArgumentError when using wait or wait_until ActiveJob options #194

brennana opened this issue Apr 15, 2016 · 2 comments

Comments

@brennana
Copy link
Contributor

Attempting to set a wait or wait_until time for a job, and then calling perform_later, causes an ArgumentError.

For instance,

MyJob.set(wait: 2.minutes).perform_later("Pablo")

causes an ArgumentError as such:

ArgumentError: wrong number of arguments (2 for 1)
        /home/andy/.rvm/gems/ruby-2.2.4/gems/shoryuken-2.0.4/lib/shoryuken/extensions/active_job_adapter.rb:33:in `enqueue'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/shoryuken-2.0.4/lib/shoryuken/extensions/active_job_adapter.rb:29:in `enqueue_at'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activejob-4.2.6/lib/active_job/enqueuing.rb:69:in `block in enqueue'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:117:in `call'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:117:in `call'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:343:in `call'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:343:in `block (2 levels) in simple'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activejob-4.2.6/lib/active_job/logging.rb:14:in `call'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activejob-4.2.6/lib/active_job/logging.rb:14:in `block (3 levels) in <module:Logging>'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activejob-4.2.6/lib/active_job/logging.rb:45:in `tag_logger'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activejob-4.2.6/lib/active_job/logging.rb:13:in `block (2 levels) in <module:Logging>'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:441:in `instance_exec'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:441:in `block in make_lambda'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:342:in `call'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:342:in `block in simple'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:497:in `call'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:497:in `block in around'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:778:in `_run_enqueue_callbacks'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:81:in `run_callbacks'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activejob-4.2.6/lib/active_job/enqueuing.rb:67:in `enqueue'
        /home/andy/.rvm/gems/ruby-2.2.4/gems/activejob-4.2.6/lib/active_job/configured_job.rb:13:in `perform_later'

Both wait and wait_until do this. The set operation works fine, but once perform_later is called on the job, an ArgumentError is raised.

@phstc
Copy link
Collaborator

phstc commented Apr 17, 2016

Hey @valdez42

Could you try to use Shoryuken from master? The PR #182 from @LionsHead, probably have fixed it.

@brennana
Copy link
Contributor Author

You're correct, this error is fixed in master (and 2.0.5).

Thanks,
Valdez42

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