Browse Source

Delay starting most tasks until the webserver is ready.

This prevents slow starting of the web server due to heavy downloading.
tags/0.6.7
ShyPike 14 years ago
parent
commit
c7d5ea6ecd
  1. 27
      SABnzbd.py

27
SABnzbd.py

@ -1238,21 +1238,8 @@ def main():
# Save the INI file
config.save_config(force=True)
logging.info('Starting %s-%s', sabnzbd.MY_NAME, sabnzbd.__version__)
try:
sabnzbd.start()
except:
logging.exception("Failed to start %s-%s", sabnzbd.MY_NAME, sabnzbd.__version__)
sabnzbd.halt()
print_modules()
# Upload any nzb/zip/rar/nzb.gz files from file association
if upload_nzbs:
from sabnzbd.utils.upload import add_local
for f in upload_nzbs:
add_local(f)
cherrylogtoscreen = False
sabnzbd.WEBLOGFILE = None
@ -1425,6 +1412,20 @@ def main():
if pid_path:
sabnzbd.pid_file(pid_path, cherryport)
# Start all SABnzbd tasks
logging.info('Starting %s-%s', sabnzbd.MY_NAME, sabnzbd.__version__)
try:
sabnzbd.start()
except:
logging.exception("Failed to start %s-%s", sabnzbd.MY_NAME, sabnzbd.__version__)
sabnzbd.halt()
# Upload any nzb/zip/rar/nzb.gz files from file association
if upload_nzbs:
from sabnzbd.utils.upload import add_local
for f in upload_nzbs:
add_local(f)
# Have to keep this running, otherwise logging will terminate
timer = 0
while not sabnzbd.SABSTOP:

Loading…
Cancel
Save