quirkey / resque-status

resque-status is an extension to the resque queue system that provides simple trackable jobs.
MIT License
515 stars 169 forks source link

Wrong Number of Arguments #91

Closed hamann closed 11 years ago

hamann commented 11 years ago

Hey there,

just played with resque-status and got some error...

* [18:53:56 2013-03-23] 8106: got: (Job{recover_job_queue} | Barmaid::Job::RecoverJob | ["9c2936a849f9a872008ac89520a42eaa", {"params"=>{"by_configuration"=>true, "server"=>"test1", "target"=>"ssh_localhost", "backup_id"=>"20130323T111918"}}]) * [18:53:56 2013-03-23] 8106: Running before_fork hooks with [(Job{recover_job_queue} | Barmaid::Job::RecoverJob | ["9c2936a849f9a872008ac89520a42eaa", {"params"=>{"by_configuration"=>true, "server"=>"test1", "target"=>"ssh_localhost", "backup_id"=>"20130323T111918"}}])] * [18:53:56 2013-03-23] 8106: resque-1.23.1: Forked 8111 at 1364061236 * [18:53:56 2013-03-23] 8111: resque-1.23.1: Processing recover_job_queue since 1364061236 [Barmaid::Job::RecoverJob] * [18:53:56 2013-03-23] 8111: Running after_fork hooks with [(Job{recover_job_queue} | Barmaid::Job::RecoverJob | ["9c2936a849f9a872008ac89520a42eaa", {"params"=>{"by_configuration"=>true, "server"=>"test1", "target"=>"ssh_localhost", "backup_id"=>"20130323T111918"}}])] * [18:53:56 2013-03-23] 8111: (Job{recover_job_queue} | Barmaid::Job::RecoverJob | ["9c2936a849f9a872008ac89520a42eaa", {"params"=>{"by_configuration"=>true, "server"=>"test1", "target"=>"ssh_localhost", "backup_id"=>"20130323T111918"}}]) failed: ArgumentError: wrong number of arguments (2 for 1)

module Barmaid
  module Job
    class RecoverJob
      extend Resque::Plugins::Queue::Lock
      include Resque::Plugins::Status

      def initialize(backup, path, recover_opts = {})
        @backup = backup
        @recover_opts = recover_opts
        @path = path
        @log = Logger.log('RecoverJob')
      end

      def perform
         put 'hello there!'
      end
    end
  end 
end

Any hints?

hamann commented 11 years ago

Changed my constructor to (uuid,opts{}), now it's working

zackster commented 11 years ago

@hamann can you elaborate a little more on how you fixed this? I still can't figure it out ;_;.

Do you mean you had: class RecoverJob def initialize(uuid, opts); end; end

?

hamann commented 11 years ago

yes, exactly :)

hamann commented 11 years ago

https://github.com/sauspiel/barmaid/blob/master/lib/barmaid/jobs/recover_job.rb