mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-06 16:44:29 +00:00
include the ability to profile the web server, code lifted straight from the daemon
This commit is contained in:
parent
50ae65b58a
commit
b8521e7e28
@ -59,6 +59,9 @@ class Web(_UI):
|
||||
group.add_option("-p", "--port", dest="port", type="int",
|
||||
help="Sets the port to be used for the webserver",
|
||||
action="store", default=None)
|
||||
group.add_option("--profile", dest="profile",
|
||||
help="Profile the web server code"
|
||||
action="store_true", default=False)
|
||||
try:
|
||||
import OpenSSL
|
||||
except:
|
||||
@ -107,6 +110,11 @@ class Web(_UI):
|
||||
if self.options.ssl:
|
||||
self.server.https = self.options.ssl
|
||||
|
||||
if self.options.profile:
|
||||
import hotshot
|
||||
hsp = hotshot.Profile(deluge.configmanager.get_config_dir("deluge-web.profile"))
|
||||
hsp.start()
|
||||
|
||||
self.server.install_signal_handlers()
|
||||
self.server.start()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user