aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVG <vg@devys.org>2016-05-13 17:16:14 +0200
committerVG <vg@devys.org>2016-05-13 17:16:14 +0200
commitea93fc0048565f1fa40a6ddfa2a92fb696bb4fc9 (patch)
tree2485e99ed2e04552dd3322b45927c41bb387924d
parent2829d593fbe44195d896424bc1a40dc64cf524f0 (diff)
downloadcliml-ea93fc0048565f1fa40a6ddfa2a92fb696bb4fc9.tar.gz
climl-ea93fc0048565f1fa40a6ddfa2a92fb696bb4fc9.tar.bz2
climl-ea93fc0048565f1fa40a6ddfa2a92fb696bb4fc9.zip
Add interupt handler while sleeping between retries
-rw-r--r--climl/imap.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/climl/imap.py b/climl/imap.py
index 14ecf2f..69e2117 100644
--- a/climl/imap.py
+++ b/climl/imap.py
@@ -145,7 +145,12 @@ def main(callback=None):
for oneid in idlist:
print('calling callback...')
callback('mail: ' + str(oneid))
- except (socket.error, socket.timeout):
+ except (socket.error, socket.timeout, backports.ssl.SSLError):
+ print('socket/ssl error, retrying in 10s...')
+ try:
+ time.sleep(10) # wait between retries
+ except KeyboardInterrupt:
+ break
pass
except KeyboardInterrupt:
break