Skip to content

Commit

Permalink
Add support for sleep_delay command line option
Browse files Browse the repository at this point in the history
  • Loading branch information
betamatt committed Sep 23, 2010
1 parent 7093c26 commit 34fc406
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/delayed/command.rb
Expand Up @@ -44,8 +44,9 @@ def initialize(args)
opts.on('-m', '--monitor', 'Start monitor process.') do
@monitor = true
end


opts.on('--sleep-delay N', "Amount of time to sleep when no jobs are found") do |n|
@options[:sleep_delay] = n
end
end
@args = opts.parse!(args)
end
Expand Down
1 change: 1 addition & 0 deletions lib/delayed/worker.rb
Expand Up @@ -45,6 +45,7 @@ def initialize(options={})
@quiet = options.has_key?(:quiet) ? options[:quiet] : true
self.class.min_priority = options[:min_priority] if options.has_key?(:min_priority)
self.class.max_priority = options[:max_priority] if options.has_key?(:max_priority)
self.class.sleep_delay = options[:sleep_delay] if options.has_key?(:sleep_delay)
end

# Every worker has a unique name which by default is the pid of the process. There are some
Expand Down

0 comments on commit 34fc406

Please sign in to comment.