Hi,

Resque works with Redis. Why not use Redis to keep track of executed jobs?

Jan

Op donderdag 14 augustus 2014 12:11:02 UTC+2 schreef bette...@gmail.com:
>
> Hi Friends,
>
> I have a scenario where I am calling a resque jobs within the resque job 
> which is already initiated.
>
> The below mentioned infinite code is just a example: The code will 
> executed till all the jobs are not completed. BUT the issue is that when I 
> write the below code the jobs never completed. It get stucked somewhere.
>
> NOTE: 
> 1. If I am not writing the below code then it work well. 
> 2. I am using below code to let the system know that the job is completed.
> 3. I have used the resque-status but my required is different so 
> resque-status won't help much.
> 4. Just wanted to know if there is any way I can let the system auto know 
> that the job is done.
>
>         count   = 0
>         loop do
>             break if job_ids.blank?
>             
>             job_id  = job_ids[count]
>             job     = Resque::Plugins::Status::Hash.get(job_id)
>             
>             if job["status"].eql?('completed')
>                 job_ids.delete(job_id)
>             elsif job_id["status"].eql?('failed')
>                 return false
>             end
>             count = count.eql?(1) ? 0 : 1
>             sleep(10)
>         end
>
> Thank you, for all your help
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/74e61bdb-8153-4bfb-bd94-aa9f8d4c5160%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to