Abilty to disable file bad file retry at end of download
This commit is contained in:
parent
c5de1447c8
commit
7c1da5da52
1 changed files with 6 additions and 5 deletions
|
@ -326,15 +326,15 @@ class Site(object):
|
||||||
|
|
||||||
# Download all files of the site
|
# Download all files of the site
|
||||||
@util.Noparallel(blocking=False)
|
@util.Noparallel(blocking=False)
|
||||||
def download(self, check_size=False, blind_includes=False):
|
def download(self, check_size=False, blind_includes=False, retry_bad_files=True):
|
||||||
if not self.connection_server:
|
if not self.connection_server:
|
||||||
self.log.debug("No connection server found, skipping download")
|
self.log.debug("No connection server found, skipping download")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
s = time.time()
|
s = time.time()
|
||||||
self.log.debug(
|
self.log.debug(
|
||||||
"Start downloading, bad_files: %s, check_size: %s, blind_includes: %s" %
|
"Start downloading, bad_files: %s, check_size: %s, blind_includes: %s, called by: %s" %
|
||||||
(self.bad_files, check_size, blind_includes)
|
(self.bad_files, check_size, blind_includes, Debug.formatStack())
|
||||||
)
|
)
|
||||||
gevent.spawn(self.announce, force=True)
|
gevent.spawn(self.announce, force=True)
|
||||||
if check_size: # Check the size first
|
if check_size: # Check the size first
|
||||||
|
@ -345,8 +345,9 @@ class Site(object):
|
||||||
# Download everything
|
# Download everything
|
||||||
valid = self.downloadContent("content.json", check_modifications=blind_includes)
|
valid = self.downloadContent("content.json", check_modifications=blind_includes)
|
||||||
|
|
||||||
self.onComplete.once(lambda: self.retryBadFiles(force=True))
|
if retry_bad_files:
|
||||||
self.log.debug("Download done in %.3fs" % (time.time () - s))
|
self.onComplete.once(lambda: self.retryBadFiles(force=True))
|
||||||
|
self.log.debug("Download done in %.3fs" % (time.time() - s))
|
||||||
|
|
||||||
return valid
|
return valid
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue