Browse Source

Prevent a failed job from saving new admin files. (#652)

Can happen when a job is aborted due to the "abort if cannot be completed" option.
Some outstanding articles may still come in after the job is set to "failed".
tags/1.1.0RC3
shypike 9 years ago
committed by GitHub
parent
commit
2cc7120ada
  1. 4
      sabnzbd/articlecache.py
  2. 2
      sabnzbd/nzbqueue.py
  3. 2
      sabnzbd/nzbstuff.py

4
sabnzbd/articlecache.py

@ -79,7 +79,7 @@ class ArticleCache(object):
nzf = article.nzf
nzo = nzf.nzo
if nzo.status in (Status.COMPLETED, Status.DELETED):
if nzo.status in (Status.COMPLETED, Status.DELETED, Status.FAILED):
# Do not discard this article because the
# file might still be processed at this moment!!
if sabnzbd.LOG_ALL:
@ -161,7 +161,7 @@ class ArticleCache(object):
nzf = article.nzf
nzo = nzf.nzo
if nzo.status in (Status.COMPLETED, Status.DELETED):
if nzo.status in (Status.COMPLETED, Status.DELETED, Status.FAILED):
# Do not discard this article because the
# file might still be processed at this moment!!
if sabnzbd.LOG_ALL:

2
sabnzbd/nzbqueue.py

@ -806,7 +806,7 @@ class NzbQueue(TryList):
if reset:
self.reset_try_list()
if nzo.status in (Status.COMPLETED, Status.DELETED):
if nzo.status in (Status.COMPLETED, Status.DELETED, Status.FAILED):
logging.debug('Discarding file completion %s for deleted job', filename)
else:
if file_done:

2
sabnzbd/nzbstuff.py

@ -1581,7 +1581,7 @@ class NzbObject(TryList):
def save_to_disk(self):
""" Save job's admin to disk """
self.save_attribs()
if self.nzo_id and self.status not in (Status.COMPLETED, Status.DELETED):
if self.nzo_id and self.status not in (Status.COMPLETED, Status.DELETED, Status.FAILED):
sabnzbd.save_data(self, self.nzo_id, self.workpath)
def save_attribs(self):

Loading…
Cancel
Save