1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 03:22:22 -05:00

Test fix #2 for FreeNAS running as a daemon

This commit is contained in:
echel0n 2014-06-18 12:07:53 -07:00
parent da826d24d4
commit 5b866006b4

View File

@ -139,8 +139,6 @@ def main():
TV for me
"""
io_loop = IOLoop.current()
# do some preliminary stuff
sickbeard.MY_FULLNAME = os.path.normpath(os.path.abspath(__file__))
sickbeard.MY_NAME = os.path.basename(sickbeard.MY_FULLNAME)
@ -310,12 +308,6 @@ def main():
sickbeard.showList = []
if sickbeard.DAEMON:
daemonize()
# Use this PID for everything
sickbeard.PID = os.getpid()
if forcedPort:
logger.log(u"Forcing web server to port " + str(forcedPort))
startPort = forcedPort
@ -359,6 +351,12 @@ 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()
@ -370,6 +368,9 @@ def main():
if forceUpdate or sickbeard.UPDATE_SHOWS_ON_START:
sickbeard.showUpdateScheduler.action.run(force=True) # @UndefinedVariable
# get ioloop
io_loop = IOLoop.current()
# init startup tasks
io_loop.add_timeout(datetime.timedelta(seconds=5), startup)