diff options
author | bendikro <bro.devel+deluge@gmail.com> | 2016-04-13 21:38:33 +0200 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2016-04-18 15:49:30 +0100 |
commit | 70d8b65f0a499d36f21c2c311ee02e3a9d67f03d (patch) | |
tree | de6c65ff7d0421e24f6427dbfbe81aa1ee234e5f /deluge/ui/web/server.py | |
parent | 5ebe14e452a61602ea43545d696a5ba288d38b42 (diff) | |
download | deluge-70d8b65f0a499d36f21c2c311ee02e3a9d67f03d.tar.gz deluge-70d8b65f0a499d36f21c2c311ee02e3a9d67f03d.tar.bz2 deluge-70d8b65f0a499d36f21c2c311ee02e3a9d67f03d.zip |
[WebUi] [Core] Fixes to plugin handling and WebUi plugin + tests
This should fix problems with errors occuring when failing to
enable plugins. Errors in plugin handling are handled better
and properly logged.
WebUI plugin in particular had issues when being enabled and disabled
multiple times because it was trying to create DelugeWeb component
each time it was enabled. If deluge-web is already listening on
the same port, enabling the WebUI plugin will fail, and the checkbox
will not be checked.
There are still some issues when enabling/disabling plugins by
clicking fast multiple times on the checkbox.
Diffstat (limited to 'deluge/ui/web/server.py')
-rw-r--r-- | deluge/ui/web/server.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py index a6c8abdd9..41671f067 100644 --- a/deluge/ui/web/server.py +++ b/deluge/ui/web/server.py @@ -577,12 +577,13 @@ class DelugeWeb(component.Component): Args: standalone (bool): Whether the server runs as a standalone process If standalone, start twisted reactor. - - Returns: - Deferred """ - log.info("%s %s.", _("Starting server in PID"), os.getpid()) + if self.socket: + log.warn("DelugeWeb is already running and cannot be started") + return + self.standalone = standalone + log.info("Starting webui server at PID %s", os.getpid()) if self.https: self.start_ssl() else: @@ -629,7 +630,7 @@ class DelugeWeb(component.Component): def shutdown(self, *args): self.stop() - if self.standalone: + if self.standalone and reactor.running: reactor.stop() |