Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Option to start delayed_job monitor process

  • Loading branch information...
commit c99538c9db20d15a044112fb538d1a903f238311 1 parent b8ed8e8
Pavel Dusanek authored May 07, 2010

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. 8  lib/delayed/command.rb
8  lib/delayed/command.rb
@@ -14,6 +14,7 @@ def initialize(args)
14 14
       }
15 15
       
16 16
       @worker_count = 1
  17
+      @monitor = false
17 18
       
18 19
       opts = OptionParser.new do |opts|
19 20
         opts.banner = "Usage: #{File.basename($0)} [options] start|stop|restart|run"
@@ -40,6 +41,11 @@ def initialize(args)
40 41
         opts.on('-i', '--identifier=n', 'A numeric identifier for the worker.') do |n|
41 42
           @options[:identifier] = n
42 43
         end
  44
+        opts.on('-m', '--monitor', 'Start monitor process.') do
  45
+          @monitor = true
  46
+        end
  47
+        
  48
+
43 49
       end
44 50
       @args = opts.parse!(args)
45 51
     end
@@ -68,7 +74,7 @@ def daemonize
68 74
     end
69 75
     
70 76
     def run_process(process_name, dir)
71  
-      Daemons.run_proc(process_name, :dir => dir, :dir_mode => :normal, :ARGV => @args) do |*args|
  77
+      Daemons.run_proc(process_name, :dir => dir, :dir_mode => :normal, :monitor => @monitor, :ARGV => @args) do |*args|
72 78
         run process_name
73 79
       end
74 80
     end

0 notes on commit c99538c

Please sign in to comment.
Something went wrong with that request. Please try again.