mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 13:56:47 +00:00
disconnect the client if getting information fails
This commit is contained in:
parent
3c24d72489
commit
b69e25e308
@ -668,7 +668,8 @@ class WebApi(JSONComponent):
|
|||||||
c.disconnect()
|
c.disconnect()
|
||||||
callback(_("Online"), info)
|
callback(_("Online"), info)
|
||||||
|
|
||||||
def on_info_fail(reason):
|
def on_info_fail(reason, c):
|
||||||
|
c.disconnect()
|
||||||
callback(_("Offline"))
|
callback(_("Offline"))
|
||||||
|
|
||||||
if not connected:
|
if not connected:
|
||||||
@ -677,7 +678,7 @@ class WebApi(JSONComponent):
|
|||||||
|
|
||||||
d = c.daemon.info()
|
d = c.daemon.info()
|
||||||
d.addCallback(on_info, c)
|
d.addCallback(on_info, c)
|
||||||
d.addErrback(on_info_fail)
|
d.addErrback(on_info_fail, c)
|
||||||
|
|
||||||
def on_connect_failed(reason, host_id):
|
def on_connect_failed(reason, host_id):
|
||||||
callback(_("Offline"))
|
callback(_("Offline"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user