mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 07:28:39 +00:00
Fix signalreceiver crashing on daemon switch.
Fix exception on shutdown in signalreceiver.
This commit is contained in:
parent
969b43d069
commit
5d91c170e4
2 changed files with 1 additions and 7 deletions
|
@ -45,7 +45,7 @@ class Signals(component.Component):
|
||||||
if not client.is_localhost():
|
if not client.is_localhost():
|
||||||
self.receiver.set_remote(True)
|
self.receiver.set_remote(True)
|
||||||
|
|
||||||
self.receiver.start()
|
self.receiver.run()
|
||||||
self.receiver.connect_to_signal("torrent_added",
|
self.receiver.connect_to_signal("torrent_added",
|
||||||
self.torrent_added_signal)
|
self.torrent_added_signal)
|
||||||
self.receiver.connect_to_signal("torrent_removed",
|
self.receiver.connect_to_signal("torrent_removed",
|
||||||
|
|
|
@ -46,21 +46,16 @@ import threading
|
||||||
from deluge.log import LOG as log
|
from deluge.log import LOG as log
|
||||||
|
|
||||||
class SignalReceiver(
|
class SignalReceiver(
|
||||||
threading.Thread,
|
|
||||||
ThreadingMixIn,
|
ThreadingMixIn,
|
||||||
SimpleXMLRPCServer.SimpleXMLRPCServer):
|
SimpleXMLRPCServer.SimpleXMLRPCServer):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
log.debug("SignalReceiver init..")
|
log.debug("SignalReceiver init..")
|
||||||
gobject.threads_init()
|
gobject.threads_init()
|
||||||
threading.Thread.__init__(self)
|
|
||||||
|
|
||||||
# Set to true so that the receiver thread will exit
|
# Set to true so that the receiver thread will exit
|
||||||
self._shutdown = False
|
self._shutdown = False
|
||||||
|
|
||||||
# Daemonize the thread so it exits when the main program does
|
|
||||||
self.setDaemon(True)
|
|
||||||
|
|
||||||
self.signals = {}
|
self.signals = {}
|
||||||
|
|
||||||
self.remote = False
|
self.remote = False
|
||||||
|
@ -125,7 +120,6 @@ class SignalReceiver(
|
||||||
while not self._shutdown:
|
while not self._shutdown:
|
||||||
self.handle_request()
|
self.handle_request()
|
||||||
self._shutdown = False
|
self._shutdown = False
|
||||||
self.server_close()
|
|
||||||
|
|
||||||
def emit_signal(self, signal, *data):
|
def emit_signal(self, signal, *data):
|
||||||
"""Exported method used by the core to emit a signal to the client"""
|
"""Exported method used by the core to emit a signal to the client"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue