mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-27 03:36:16 +00:00
Fix signalreceiver crashing on daemon switch.
Fix exception on shutdown in signalreceiver.
This commit is contained in:
parent
969b43d069
commit
5d91c170e4
@ -45,7 +45,7 @@ class Signals(component.Component):
|
||||
if not client.is_localhost():
|
||||
self.receiver.set_remote(True)
|
||||
|
||||
self.receiver.start()
|
||||
self.receiver.run()
|
||||
self.receiver.connect_to_signal("torrent_added",
|
||||
self.torrent_added_signal)
|
||||
self.receiver.connect_to_signal("torrent_removed",
|
||||
|
@ -46,21 +46,16 @@ import threading
|
||||
from deluge.log import LOG as log
|
||||
|
||||
class SignalReceiver(
|
||||
threading.Thread,
|
||||
ThreadingMixIn,
|
||||
SimpleXMLRPCServer.SimpleXMLRPCServer):
|
||||
|
||||
def __init__(self):
|
||||
log.debug("SignalReceiver init..")
|
||||
gobject.threads_init()
|
||||
threading.Thread.__init__(self)
|
||||
|
||||
# Set to true so that the receiver thread will exit
|
||||
self._shutdown = False
|
||||
|
||||
# Daemonize the thread so it exits when the main program does
|
||||
self.setDaemon(True)
|
||||
|
||||
self.signals = {}
|
||||
|
||||
self.remote = False
|
||||
@ -125,7 +120,6 @@ class SignalReceiver(
|
||||
while not self._shutdown:
|
||||
self.handle_request()
|
||||
self._shutdown = False
|
||||
self.server_close()
|
||||
|
||||
def emit_signal(self, signal, *data):
|
||||
"""Exported method used by the core to emit a signal to the client"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user