mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-03 18:03:37 +00: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
3 changed files with 14 additions and 11 deletions
17
SickBeard.py
17
SickBeard.py
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
# Check needed software dependencies to nudge users to fix their setup
|
# Check needed software dependencies to nudge users to fix their setup
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
import functools
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
|
@ -376,7 +377,14 @@ def main():
|
||||||
}
|
}
|
||||||
|
|
||||||
# init tornado
|
# 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():
|
def startup():
|
||||||
# Fire up all our threads
|
# Fire up all our threads
|
||||||
|
@ -390,20 +398,15 @@ def main():
|
||||||
if forceUpdate or sickbeard.UPDATE_SHOWS_ON_START:
|
if forceUpdate or sickbeard.UPDATE_SHOWS_ON_START:
|
||||||
sickbeard.showUpdateScheduler.action.run(force=True) # @UndefinedVariable
|
sickbeard.showUpdateScheduler.action.run(force=True) # @UndefinedVariable
|
||||||
|
|
||||||
|
# If we restarted then unset the restarted flag
|
||||||
if sickbeard.restarted:
|
if sickbeard.restarted:
|
||||||
sickbeard.restarted = False
|
sickbeard.restarted = False
|
||||||
|
|
||||||
# create ioloop
|
# create ioloop
|
||||||
io_loop = IOLoop.current()
|
io_loop = IOLoop.current()
|
||||||
|
|
||||||
# init startup tasks
|
|
||||||
io_loop.add_timeout(datetime.timedelta(seconds=5), startup)
|
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()
|
io_loop.start()
|
||||||
sickbeard.saveAndShutdown()
|
sickbeard.saveAndShutdown()
|
||||||
|
|
||||||
|
|
|
@ -57,8 +57,11 @@ class CheckVersion():
|
||||||
if self.check_for_new_version():
|
if self.check_for_new_version():
|
||||||
if sickbeard.AUTO_UPDATE:
|
if sickbeard.AUTO_UPDATE:
|
||||||
logger.log(u"New update found for SickRage, starting auto-updater ...")
|
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():
|
if sickbeard.versionCheckScheduler.action.update():
|
||||||
logger.log(u"Update was successful!")
|
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):
|
def find_install_type(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -106,11 +106,8 @@ def initWebServer(options={}):
|
||||||
logger.log(u"Starting SickRage on " + protocol + "://" + str(options['host']) + ":" + str(
|
logger.log(u"Starting SickRage on " + protocol + "://" + str(options['host']) + ":" + str(
|
||||||
options['port']) + "/")
|
options['port']) + "/")
|
||||||
|
|
||||||
try:
|
if not sickbeard.restarted:
|
||||||
server.listen(options['port'], options['host'])
|
server.listen(options['port'], options['host'])
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def shutdown():
|
def shutdown():
|
||||||
global server
|
global server
|
||||||
|
|
Loading…
Reference in a new issue