[tor-commits] [flashproxy/master] Unconditionally rate-limit and reconnect after imap_loop.

dcf at torproject.org dcf at torproject.org
Sun May 5 10:00:27 UTC 2013


commit f612910c4bd3c5c845248ff44d405f9b92be078f
Author: David Fifield <david at bamsoftware.com>
Date:   Sat May 4 22:33:52 2013 -0700

    Unconditionally rate-limit and reconnect after imap_loop.
    
    Previously we did this only on an exception, but the only way imap_loop
    can finish is by an exception.
---
 facilitator/facilitator-email-poller |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/facilitator/facilitator-email-poller b/facilitator/facilitator-email-poller
index c90fa66..2e240e0 100755
--- a/facilitator/facilitator-email-poller
+++ b/facilitator/facilitator-email-poller
@@ -330,13 +330,12 @@ while True:
     except imaplib.IMAP4.abort, e:
         # Try again after a disconnection.
         log(u"lost server connection: %s" % str(e))
-        # Don't reconnect too fast.
-        t = login_limit.time_to_wait()
-        if t > 0:
-            log(u"waiting %.2f seconds before logging in again" % t)
-            time.sleep(t)
-    else:
-        break
+
+    # Don't reconnect too fast.
+    t = login_limit.time_to_wait()
+    if t > 0:
+        log(u"waiting %.2f seconds before logging in again" % t)
+        time.sleep(t)
 
 log(u"closing")
 imap.close()





More information about the tor-commits mailing list