mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-30 21:26:02 +00:00
Fix deregistering signal receivers in the core.
This commit is contained in:
parent
50e6b343c3
commit
468e51c72b
@ -50,8 +50,8 @@ class SignalManager(component.Component):
|
||||
def deregister_client(self, address):
|
||||
"""Deregisters a client"""
|
||||
log.debug("Deregistering %s as a signal reciever..", address)
|
||||
for client in self.clients:
|
||||
if client[:len(address)] == address:
|
||||
for client in self.clients.keys():
|
||||
if client.split("//")[1].split(":")[0] == address:
|
||||
del self.clients[client]
|
||||
break
|
||||
|
||||
|
@ -94,7 +94,8 @@ class SignalReceiver(
|
||||
self._shutdown = True
|
||||
# De-register with the daemon so it doesn't try to send us more signals
|
||||
client.deregister_client()
|
||||
|
||||
client.force_call()
|
||||
|
||||
# Hacky.. sends a request to our local receiver to ensure that it
|
||||
# shutdowns.. This is because handle_request() is a blocking call.
|
||||
receiver = xmlrpclib.ServerProxy("http://localhost:" + str(self.port),
|
||||
|
Loading…
x
Reference in New Issue
Block a user