Fix endless loop when trying to autoconnect to an offline daemon

This commit is contained in:
Andrew Resch 2009-11-13 05:26:54 +00:00
parent 330b8b3ced
commit 1a1ab4e780

View File

@ -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"]: