Skip to content

Commit

Permalink
Option -p / --prefix prepends identifier to worker process names.
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnall authored and gaffneyc committed Feb 11, 2011
1 parent fc5bdcf commit e4c91da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/delayed/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def initialize(args)
opts.on('--sleep-delay N', "Amount of time to sleep when no jobs are found") do |n|
@options[:sleep_delay] = n
end
opts.on('-p', '--prefix NAME', "String to be prefixed to worker process names") do |prefix|
@options[:prefix] = prefix
end
end
@args = opts.parse!(args)
end
Expand Down Expand Up @@ -76,6 +79,7 @@ def daemonize

def run_process(process_name, dir)
Daemons.run_proc(process_name, :dir => dir, :dir_mode => :normal, :monitor => @monitor, :ARGV => @args) do |*args|
$0 = File.join @options[:prefix], process_name if @options[:prefix]
run process_name
end
end
Expand Down

0 comments on commit e4c91da

Please sign in to comment.