mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Fix endless loop when trying to autoconnect to an offline daemon
This commit is contained in:
parent
330b8b3ced
commit
1a1ab4e780
1 changed files with 3 additions and 6 deletions
|
@ -310,9 +310,6 @@ Please see the details below for more information."), details=traceback.format_e
|
||||||
_("Error Starting Daemon"),
|
_("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()
|
_("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):
|
def on_connect(connector):
|
||||||
component.start()
|
component.start()
|
||||||
def on_connect_fail(result, try_counter):
|
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
|
try_counter -= 1
|
||||||
import time
|
import time
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
do_connect()
|
do_connect(try_counter)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def do_connect():
|
def do_connect(try_counter):
|
||||||
client.connect(*host[1:]).addCallback(on_connect).addErrback(on_connect_fail, try_counter)
|
client.connect(*host[1:]).addCallback(on_connect).addErrback(on_connect_fail, try_counter)
|
||||||
|
|
||||||
if try_connect:
|
if try_connect:
|
||||||
do_connect()
|
do_connect(6)
|
||||||
break
|
break
|
||||||
|
|
||||||
if self.config["show_connection_manager_on_start"]:
|
if self.config["show_connection_manager_on_start"]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue