mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-01 08:53:37 +00:00
Test fix #2 for FreeNAS running as a daemon
This commit is contained in:
parent
da826d24d4
commit
5b866006b4
1 changed files with 9 additions and 8 deletions
17
SickBeard.py
17
SickBeard.py
|
@ -139,8 +139,6 @@ def main():
|
||||||
TV for me
|
TV for me
|
||||||
"""
|
"""
|
||||||
|
|
||||||
io_loop = IOLoop.current()
|
|
||||||
|
|
||||||
# do some preliminary stuff
|
# do some preliminary stuff
|
||||||
sickbeard.MY_FULLNAME = os.path.normpath(os.path.abspath(__file__))
|
sickbeard.MY_FULLNAME = os.path.normpath(os.path.abspath(__file__))
|
||||||
sickbeard.MY_NAME = os.path.basename(sickbeard.MY_FULLNAME)
|
sickbeard.MY_NAME = os.path.basename(sickbeard.MY_FULLNAME)
|
||||||
|
@ -310,12 +308,6 @@ def main():
|
||||||
|
|
||||||
sickbeard.showList = []
|
sickbeard.showList = []
|
||||||
|
|
||||||
if sickbeard.DAEMON:
|
|
||||||
daemonize()
|
|
||||||
|
|
||||||
# Use this PID for everything
|
|
||||||
sickbeard.PID = os.getpid()
|
|
||||||
|
|
||||||
if forcedPort:
|
if forcedPort:
|
||||||
logger.log(u"Forcing web server to port " + str(forcedPort))
|
logger.log(u"Forcing web server to port " + str(forcedPort))
|
||||||
startPort = forcedPort
|
startPort = forcedPort
|
||||||
|
@ -359,6 +351,12 @@ def main():
|
||||||
loadShowsFromDB()
|
loadShowsFromDB()
|
||||||
|
|
||||||
def startup():
|
def startup():
|
||||||
|
if sickbeard.DAEMON:
|
||||||
|
daemonize()
|
||||||
|
|
||||||
|
# Use this PID for everything
|
||||||
|
sickbeard.PID = os.getpid()
|
||||||
|
|
||||||
# Fire up all our threads
|
# Fire up all our threads
|
||||||
sickbeard.start()
|
sickbeard.start()
|
||||||
|
|
||||||
|
@ -370,6 +368,9 @@ 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
|
||||||
|
|
||||||
|
# get ioloop
|
||||||
|
io_loop = IOLoop.current()
|
||||||
|
|
||||||
# init startup tasks
|
# init startup tasks
|
||||||
io_loop.add_timeout(datetime.timedelta(seconds=5), startup)
|
io_loop.add_timeout(datetime.timedelta(seconds=5), startup)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue