mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-03 01:43:37 +00:00
Fix for OSError: [Errno 9] Bad file descriptor error, freebsd related
This commit is contained in:
parent
c792e34c43
commit
5aba53ae8e
1 changed files with 13 additions and 10 deletions
23
SickBeard.py
23
SickBeard.py
|
@ -75,7 +75,6 @@ signal.signal(signal.SIGINT, sickbeard.sig_handler)
|
||||||
signal.signal(signal.SIGTERM, sickbeard.sig_handler)
|
signal.signal(signal.SIGTERM, sickbeard.sig_handler)
|
||||||
|
|
||||||
throwaway = datetime.datetime.strptime('20110101', '%Y%m%d')
|
throwaway = datetime.datetime.strptime('20110101', '%Y%m%d')
|
||||||
io_loop = IOLoop.current()
|
|
||||||
|
|
||||||
def loadShowsFromDB():
|
def loadShowsFromDB():
|
||||||
"""
|
"""
|
||||||
|
@ -303,6 +302,12 @@ def main():
|
||||||
MAX_DB_VERSION) + ").\n" + \
|
MAX_DB_VERSION) + ").\n" + \
|
||||||
"If you have used other forks of SB, your database may be unusable due to their modifications.")
|
"If you have used other forks of SB, your database may be unusable due to their modifications.")
|
||||||
|
|
||||||
|
if sickbeard.DAEMON:
|
||||||
|
daemonize()
|
||||||
|
|
||||||
|
# Use this PID for everything
|
||||||
|
sickbeard.PID = os.getpid()
|
||||||
|
|
||||||
# Initialize the config and our threads
|
# Initialize the config and our threads
|
||||||
sickbeard.initialize(consoleLogging=consoleLogging)
|
sickbeard.initialize(consoleLogging=consoleLogging)
|
||||||
|
|
||||||
|
@ -341,7 +346,7 @@ def main():
|
||||||
'handle_reverse_proxy': sickbeard.HANDLE_REVERSE_PROXY,
|
'handle_reverse_proxy': sickbeard.HANDLE_REVERSE_PROXY,
|
||||||
'https_cert': sickbeard.HTTPS_CERT,
|
'https_cert': sickbeard.HTTPS_CERT,
|
||||||
'https_key': sickbeard.HTTPS_KEY,
|
'https_key': sickbeard.HTTPS_KEY,
|
||||||
}
|
}
|
||||||
|
|
||||||
# init tornado
|
# init tornado
|
||||||
webserveInit.initWebServer(options)
|
webserveInit.initWebServer(options)
|
||||||
|
@ -362,6 +367,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
|
||||||
|
|
||||||
|
# create 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)
|
||||||
|
|
||||||
|
@ -370,15 +378,10 @@ def main():
|
||||||
if sickbeard.AUTO_UPDATE:
|
if sickbeard.AUTO_UPDATE:
|
||||||
tornado.autoreload.start(io_loop)
|
tornado.autoreload.start(io_loop)
|
||||||
|
|
||||||
if sickbeard.DAEMON:
|
io_loop.start()
|
||||||
daemonize()
|
sickbeard.saveAndShutdown()
|
||||||
|
|
||||||
# Use this PID for everything
|
|
||||||
sickbeard.PID = os.getpid()
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if sys.hexversion >= 0x020600F0:
|
if sys.hexversion >= 0x020600F0:
|
||||||
freeze_support()
|
freeze_support()
|
||||||
main()
|
main()
|
||||||
io_loop.start()
|
|
||||||
sickbeard.saveAndShutdown()
|
|
Loading…
Reference in a new issue