diff options
author | Elvin Efendi <elvin.efendiyev@gmail.com> | 2016-06-02 23:53:29 +0200 |
---|---|---|
committer | Elvin Efendi <elvin.efendiyev@gmail.com> | 2016-06-02 23:53:29 +0200 |
commit | aef81bd14989797d26d349fdf1a517045f5af33c (patch) | |
tree | db194c27c1fa4c8542a048e4afd8dcb0793acb27 /lib/oxidized/worker.rb | |
parent | 779f20dd18a361b5bde51f3f11c6d048efe100a0 (diff) | |
parent | 64bdbeb673a8ab7155478ee5e0d1d58c1631a9d3 (diff) |
Merge pull request #25 from Shopify/debug-statements
Debug statements
Diffstat (limited to 'lib/oxidized/worker.rb')
-rw-r--r-- | lib/oxidized/worker.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/oxidized/worker.rb b/lib/oxidized/worker.rb index 48852ef..1952d01 100644 --- a/lib/oxidized/worker.rb +++ b/lib/oxidized/worker.rb @@ -14,7 +14,7 @@ module Oxidized ended.each { |job| process job } @jobs.work while @jobs.size < @jobs.want - Oxidized.logger.debug "Jobs #{@jobs.size}, Want: #{@jobs.want}" + Oxidized.logger.debug "lib/oxidized/worker.rb: Jobs #{@jobs.size}, Want: #{@jobs.want}" # ask for next node in queue non destructive way nextnode = @nodes.first unless nextnode.last.nil? @@ -26,7 +26,9 @@ module Oxidized node = @nodes.get node.running? ? next : node.running = true @jobs.push Job.new node + Oxidized.logger.debug "lib/oxidized/worker.rb: Added #{node.name} to the job queue" end + Oxidized.logger.debug("lib/oxidized/worker.rb: #{@jobs.size} jobs running in parallel") unless @jobs.empty? end def process job |