mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-25 17:45:26 +00:00
Handle shutdown() better
This commit is contained in:
parent
447620f89f
commit
1d006e1368
@ -156,11 +156,14 @@ class Daemon(object):
|
|||||||
component.start()
|
component.start()
|
||||||
try:
|
try:
|
||||||
reactor.run()
|
reactor.run()
|
||||||
except KeyboardInterrupt:
|
finally:
|
||||||
self.shutdown()
|
self._shutdown()
|
||||||
|
|
||||||
@export()
|
@export()
|
||||||
def shutdown(self, *args, **kwargs):
|
def shutdown(self, *args, **kwargs):
|
||||||
|
reactor.callLater(0, reactor.stop)
|
||||||
|
|
||||||
|
def _shutdown(self, *args, **kwargs):
|
||||||
try:
|
try:
|
||||||
os.remove(deluge.configmanager.get_config_dir("deluged.pid"))
|
os.remove(deluge.configmanager.get_config_dir("deluged.pid"))
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user