• Download Gist
Delayed::Job daemon script for delayed_job
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/env ruby
require 'rubygems'
require 'daemons'
dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
 
daemon_options = {
:multiple => false,
:dir_mode => :normal,
:dir => File.join(dir, 'tmp', 'pids'),
:backtrace => true
}
 
Daemons.run_proc('job_runner', daemon_options) do
Dir.chdir dir
RAILS_ENV = ARGV[1] || ENV['RAILS_ENV'] || 'development'
require File.join('config', 'environment')
 
Delayed::Worker.new.start
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.