From 1a1ab4e780110d8ac886374745e45ceaa56b8ff7 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 13 Nov 2009 05:26:54 +0000 Subject: [PATCH] Fix endless loop when trying to autoconnect to an offline daemon --- deluge/ui/gtkui/gtkui.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 7f9680ec8..b8f435716 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -310,9 +310,6 @@ Please see the details below for more information."), details=traceback.format_e _("Error Starting Daemon"), _("There was an error starting the daemon process. Try running it from a console to see if there is an error.")).run() - # We'll try 30 reconnects at 500ms intervals - try_counter = 30 - def on_connect(connector): component.start() def on_connect_fail(result, try_counter): @@ -323,14 +320,14 @@ Please see the details below for more information."), details=traceback.format_e try_counter -= 1 import time time.sleep(0.5) - do_connect() + do_connect(try_counter) return result - def do_connect(): + def do_connect(try_counter): client.connect(*host[1:]).addCallback(on_connect).addErrback(on_connect_fail, try_counter) if try_connect: - do_connect() + do_connect(6) break if self.config["show_connection_manager_on_start"]: