Permalink
Browse files

Option to start delayed_job monitor process

  • Loading branch information...
1 parent b8ed8e8 commit c99538c9db20d15a044112fb538d1a903f238311 @dush dush committed May 7, 2010
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/delayed/command.rb
@@ -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"
@@ -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
@@ -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

0 comments on commit c99538c

Please sign in to comment.