[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [snowflake/master] Stop logging debug message while counting down



commit 5aca6028f9962e7f54c1b9bbc8d72330ae65af19
Author: Arlo Breault <arlolra@xxxxxxxxx>
Date:   Wed May 1 11:43:38 2019 -0400

    Stop logging debug message while counting down
---
 proxy/snowflake.coffee | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

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



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits