Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Option to start delayed_job monitor process
  • Loading branch information
dush committed May 7, 2010
1 parent b8ed8e8 commit c99538c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/delayed/command.rb
Expand Up @@ -14,6 +14,7 @@ def initialize(args)
}

@worker_count = 1
@monitor = false

opts = OptionParser.new do |opts|
opts.banner = "Usage: #{File.basename($0)} [options] start|stop|restart|run"
Expand All @@ -40,6 +41,11 @@ def initialize(args)
opts.on('-i', '--identifier=n', 'A numeric identifier for the worker.') do |n|
@options[:identifier] = n
end
opts.on('-m', '--monitor', 'Start monitor process.') do
@monitor = true
end


end
@args = opts.parse!(args)
end
Expand Down Expand Up @@ -68,7 +74,7 @@ def daemonize
end

def run_process(process_name, dir)
Daemons.run_proc(process_name, :dir => dir, :dir_mode => :normal, :ARGV => @args) do |*args|
Daemons.run_proc(process_name, :dir => dir, :dir_mode => :normal, :monitor => @monitor, :ARGV => @args) do |*args|
run process_name
end
end
Expand Down

0 comments on commit c99538c

Please sign in to comment.