From 330b8b3ced62f8cd4eb546dd44d5f73df43afc9c Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 13 Nov 2009 05:22:38 +0000 Subject: [PATCH] Fix autoconnecting to the next host in the list if the selected one isn't available --- deluge/ui/gtkui/gtkui.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 37f44861c..7f9680ec8 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -309,10 +309,10 @@ Please see the details below for more information."), details=traceback.format_e dialogs.ErrorDialog( _("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): @@ -325,13 +325,13 @@ Please see the details below for more information."), details=traceback.format_e time.sleep(0.5) do_connect() return result - + def do_connect(): client.connect(*host[1:]).addCallback(on_connect).addErrback(on_connect_fail, try_counter) - + if try_connect: do_connect() - + break if self.config["show_connection_manager_on_start"]: # XXX: We need to call a simulate() here, but this could be a bug in twisted