Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Option -p / --prefix prepends identifier to worker process names.

  • Loading branch information...
commit e4c91daf96a953079def7ae22cb0bd062eea6ef2 1 parent fc5bdcf
@pwnall pwnall authored gaffneyc committed
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/delayed/command.rb
View
4 lib/delayed/command.rb
@@ -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
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.