Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for sleep_delay command line option

  • Loading branch information...
commit 34fc406e44839cc1f6990d775f4a79ff7ebc5506 1 parent 7093c26
@betamatt betamatt authored
Showing with 4 additions and 2 deletions.
  1. +3 −2 lib/delayed/command.rb
  2. +1 −0  lib/delayed/worker.rb
View
5 lib/delayed/command.rb
@@ -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
View
1  lib/delayed/worker.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.