diff --git a/SickBeard.py b/SickBeard.py index fae31566..bd9f3121 100755 --- a/SickBeard.py +++ b/SickBeard.py @@ -351,12 +351,6 @@ def main(): loadShowsFromDB() def startup(): - if sickbeard.DAEMON: - daemonize() - - # Use this PID for everything - sickbeard.PID = os.getpid() - # Fire up all our threads sickbeard.start() @@ -379,6 +373,12 @@ def main(): if sickbeard.AUTO_UPDATE: tornado.autoreload.start(io_loop) + if sickbeard.DAEMON: + daemonize() + + # Use this PID for everything + sickbeard.PID = os.getpid() + # start IOLoop. io_loop.start() sickbeard.saveAndShutdown() diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 9ce0da01..333dc257 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -83,14 +83,7 @@ from Cheetah.Template import Template from tornado import gen from tornado.web import RequestHandler, HTTPError, asynchronous -# def _handle_reverse_proxy(): -# if sickbeard.HANDLE_REVERSE_PROXY: -# cherrypy.lib.cptools.proxy() - -# cherrypy.tools.handle_reverse_proxy = cherrypy.Tool('before_handler', _handle_reverse_proxy) - req_headers = None - def authenticated(handler_class): def wrap_execute(handler_execute): def basicauth(handler, transforms, *args, **kwargs):