Skip to content

Instantly share code, notes, and snippets.

@mrrooijen
Created October 2, 2010 18:43
Show Gist options
  • Save mrrooijen/607883 to your computer and use it in GitHub Desktop.
Save mrrooijen/607883 to your computer and use it in GitHub Desktop.
A replacement script for the one currently in HEAD.
#!/usr/bin/env ruby
require 'rubygems'
require 'daemons'
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
PID_DIR = File.join(RAILS_ROOT, 'tmp', 'pids')
Daemons.run_proc('delayed_job', { :dir => PID_DIR, :dir_mode => :normal }) do
ENV['RAILS_ENV'] ||= 'development'
Dir.chdir RAILS_ROOT
require File.join('config', 'environment')
Delayed::Worker.new.start
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment