Stop logging debug message while counting down

This commit is contained in:
Arlo Breault 2019-05-01 11:43:38 -04:00
parent 898ba57070
commit 5aca6028f9

View file

@ -52,13 +52,14 @@ class Snowflake
# serving at capacity, at which point stop polling. # serving at capacity, at which point stop polling.
pollBroker: -> pollBroker: ->
# Temporary countdown. TODO: Simplify # Temporary countdown. TODO: Simplify
countdown = (msg, sec) => countdown = (msg, sec, skip) =>
dbg msg if not skip then dbg msg
@ui?.setStatus msg + ' (Polling in ' + sec + ' seconds...)' if sec > 0
sec-- @ui?.setStatus msg + ' (Polling in ' + sec + ' seconds...)'
if sec >= 0 sec--
setTimeout((-> countdown(msg, sec)), 1000) setTimeout((-> countdown(msg, sec, true)), 1000)
else else
@ui?.setStatus msg
findClients() findClients()
# Poll broker for clients. # Poll broker for clients.
findClients = => findClients = =>
@ -67,7 +68,7 @@ class Snowflake
log 'At client capacity.' log 'At client capacity.'
# Do nothing until a new proxyPair is available. # Do nothing until a new proxyPair is available.
return return
msg = 'polling for client... ' msg = 'Polling for client ... '
msg += '[retries: ' + @retries + ']' if @retries > 0 msg += '[retries: ' + @retries + ']' if @retries > 0
@ui?.setStatus msg @ui?.setStatus msg
recv = @broker.getClientOffer pair.id recv = @broker.getClientOffer pair.id