mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
Removed tornado's auto-reload function and reverted back to using our original method of performing auto-updates, this should also correct 500 internal server issues for those that got them after updates where performed automatically.
This commit is contained in:
parent
4baff1a96f
commit
b6e7635a32
17
SickBeard.py
17
SickBeard.py
@ -19,6 +19,7 @@
|
||||
|
||||
# Check needed software dependencies to nudge users to fix their setup
|
||||
from __future__ import with_statement
|
||||
import functools
|
||||
|
||||
import sys
|
||||
import shutil
|
||||
@ -376,7 +377,14 @@ def main():
|
||||
}
|
||||
|
||||
# init tornado
|
||||
webserveInit.initWebServer(options)
|
||||
try:
|
||||
webserveInit.initWebServer(options)
|
||||
except IOError:
|
||||
logger.log(u"Unable to start web server, is something else running on port %d?" % startPort, logger.ERROR)
|
||||
if sickbeard.LAUNCH_BROWSER and not sickbeard.DAEMON:
|
||||
logger.log(u"Launching browser and exiting", logger.ERROR)
|
||||
sickbeard.launchBrowser(startPort)
|
||||
sys.exit()
|
||||
|
||||
def startup():
|
||||
# Fire up all our threads
|
||||
@ -390,20 +398,15 @@ def main():
|
||||
if forceUpdate or sickbeard.UPDATE_SHOWS_ON_START:
|
||||
sickbeard.showUpdateScheduler.action.run(force=True) # @UndefinedVariable
|
||||
|
||||
# If we restarted then unset the restarted flag
|
||||
if sickbeard.restarted:
|
||||
sickbeard.restarted = False
|
||||
|
||||
# create ioloop
|
||||
io_loop = IOLoop.current()
|
||||
|
||||
# init startup tasks
|
||||
io_loop.add_timeout(datetime.timedelta(seconds=5), startup)
|
||||
|
||||
# autoreload.
|
||||
tornado.autoreload.add_reload_hook(autoreload_shutdown)
|
||||
if sickbeard.AUTO_UPDATE:
|
||||
tornado.autoreload.start(io_loop)
|
||||
|
||||
io_loop.start()
|
||||
sickbeard.saveAndShutdown()
|
||||
|
||||
|
@ -57,8 +57,11 @@ class CheckVersion():
|
||||
if self.check_for_new_version():
|
||||
if sickbeard.AUTO_UPDATE:
|
||||
logger.log(u"New update found for SickRage, starting auto-updater ...")
|
||||
ui.notifications.message('New update found for SickRage, starting auto-updater')
|
||||
if sickbeard.versionCheckScheduler.action.update():
|
||||
logger.log(u"Update was successful!")
|
||||
ui.notifications.message('Update was successful')
|
||||
threading.Timer(2, sickbeard.invoke_restart, [False]).start()
|
||||
|
||||
def find_install_type(self):
|
||||
"""
|
||||
|
@ -106,11 +106,8 @@ def initWebServer(options={}):
|
||||
logger.log(u"Starting SickRage on " + protocol + "://" + str(options['host']) + ":" + str(
|
||||
options['port']) + "/")
|
||||
|
||||
try:
|
||||
if not sickbeard.restarted:
|
||||
server.listen(options['port'], options['host'])
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def shutdown():
|
||||
global server
|
||||
|
Loading…
Reference in New Issue
Block a user