From 2735c8410e64038387510d3bc70782be0c1958e9 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 9 Nov 2012 16:03:12 -0500 Subject: [PATCH] zephyr_mirror: Catch IOError from zephyr.init(). (imported from commit d657fede53ee3754e76edf66b10bef09ad1f9577) --- bots/zephyr_mirror.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bots/zephyr_mirror.py b/bots/zephyr_mirror.py index d7ee6c3..4f90c21 100755 --- a/bots/zephyr_mirror.py +++ b/bots/zephyr_mirror.py @@ -677,5 +677,13 @@ or specify the --api-key-file option.""" % (options.api_key_file,))) sys.exit(0) import zephyr - zephyr.init() + while True: + try: + # zephyr.init() tries to clear old subscriptions, and thus + # sometimes gets a SERVNAK from the server + zephyr.init() + break + except IOError: + traceback.print_exc() + time.sleep(1) zephyr_to_humbug(options)