lib/kthxbye/job.rb in kthxbye-1.0.2 vs lib/kthxbye/job.rb in kthxbye-1.0.4

- old
+ new

@@ -31,11 +31,11 @@ Job.add_to_queue( queue, id ) Kthxbye.register_queue( queue ) # mark job as inactive currently. will mark active when job is getting run redis.redis.sadd("jobs:inactive", id) - redis.hset( "data-store:#{queue}", id, encode( {:klass => klass, :payload => args} ) ) + redis.hset( "data-store:#{queue}", id, encode( {:klass => klass.to_s, :payload => args} ) ) log "Created job in queue #{queue} with an unique key of #{id}" return id.to_i end @@ -72,10 +72,10 @@ @failed_attempts = Failure.fails_for_job(@id) # local tracking only, for rerun purposes end # Simply requeues the job to be rerun. def rerun - Job.add_to_queue( @queue, @id ) + Job.add_to_queue( @id, @queue ) end # Returns the job's status. Will be one of 4 things. # 1) :succeeded - the job ran and has a result # 2) :failed - the job failed and reported an error