Skip to content

Commit

Permalink
Fix logic to be as documented
Browse files Browse the repository at this point in the history
  • Loading branch information
ripienaar committed Oct 1, 2010
1 parent 1225d40 commit 9d47e20
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agent/puppetd/mc-puppetd
Expand Up @@ -36,21 +36,21 @@ def log(msg)
puts("#{Time.now}> #{msg}") puts("#{Time.now}> #{msg}")
end end


# Checks concurrent runs every second and returns once its # Checks concurrent runs every second and returns once its
# below the given threshold # below the given threshold
def waitfor(concurrency, client) def waitfor(concurrency, client)
logged = false logged = false


loop do loop do
running = client.status.inject(0) {|s,v| s += v[:data][:running] } running = client.status.inject(0) {|s,v| s += v[:data][:running] }


return running if running <= concurrency return running if running < concurrency


log("Currently #{running} nodes running, waiting") unless logged log("Currently #{running} nodes running, waiting") unless logged


logged = true logged = true


sleep 0.5 sleep 1
end end
end end


Expand Down

0 comments on commit 9d47e20

Please sign in to comment.