Your Ad Here

Posted By

theroamingcoder on 09/16/10


Tagged

rails ruby on job Delayed


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

kaks


Rails Delayed Job Script For Use On Shared Hosting


 / Published in: Ruby
 

Add this code to /script/jobrunner in your rails app (be sure to make it executable with chmod 775) Then setup a normal cron job to run the script

  1. #!/usr/bin/env ruby
  2. require File.dirname(__FILE__) + '/../config/environment'
  3. worker = Delayed::Worker.new
  4. worker.max_run_time = 2.minutes
  5. worker.work_off(100)

Report this snippet  

You need to login to post a comment.