Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: queue
Fetching contributors…

Cannot retrieve contributors at this time

executable file 40 lines (29 sloc) 1.166 kB
#!/usr/bin/env ruby
RAILS_HOME = File.expand_path(File.join(File.dirname(__FILE__),".."))
BDRB_HOME = File.join(RAILS_HOME,"vendor","plugins","backgroundrb")
WORKER_ROOT = File.join(RAILS_HOME,"lib","workers")
WORKER_LOAD_ENV = File.join(RAILS_HOME,"script","load_worker_env")
["server","server/lib","lib","lib/backgroundrb"].each { |x| $LOAD_PATH.unshift(BDRB_HOME + "/#{x}")}
$LOAD_PATH.unshift(WORKER_ROOT)
require "rubygems"
require "yaml"
require "erb"
require "logger"
require "packet"
require "optparse"
require "bdrb_config"
require RAILS_HOME + "/config/boot"
require "active_support"
BackgrounDRb::Config.parse_cmd_options ARGV
BDRB_CONFIG = BackgrounDRb::Config.read_config("#{RAILS_HOME}/config/backgroundrb.yml")
require RAILS_HOME + "/config/environment"
require "bdrb_job_queue"
require "backgroundrb_server"
PID_FILE = "#{RAILS_HOME}/tmp/pids/backgroundrb_#{BDRB_CONFIG[:backgroundrb][:port]}.pid"
SERVER_LOGGER = "#{RAILS_HOME}/log/backgroundrb_debug_#{BDRB_CONFIG[:backgroundrb][:port]}.log"
daemon = BackgrounDRb::StartStop.new
case ARGV[0]
when 'start'; daemon.start
when 'stop'; daemon.stop()
else; BackgrounDRb::MasterProxy.new()
end
Jump to Line
Something went wrong with that request. Please try again.