Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 30 lines (22 sloc) 747 Bytes
#!/usr/bin/env ruby
require 'rubygems'
require 'daemons'
dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
daemon_options = {
:multiple => true,
: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')
# Replace the default logger
logger = Logger.new(File.join(RAILS_ROOT, 'log', 'delayed_job.log'))
logger.level = ActiveRecord::Base.logger.level
ActiveRecord::Base.logger = logger
ActiveRecord::Base.clear_active_connections!
Delayed::Worker.logger = logger
Delayed::Worker.new.start
end
Something went wrong with that request. Please try again.