Less verbose site downloading
This commit is contained in:
parent
ae092dc757
commit
437a9b79a8
1 changed files with 10 additions and 5 deletions
|
@ -110,6 +110,7 @@ class Site(object):
|
||||||
# Download all file from content.json
|
# Download all file from content.json
|
||||||
def downloadContent(self, inner_path, download_files=True, peer=None, check_modifications=False):
|
def downloadContent(self, inner_path, download_files=True, peer=None, check_modifications=False):
|
||||||
s = time.time()
|
s = time.time()
|
||||||
|
if config.verbose:
|
||||||
self.log.debug("Downloading %s..." % inner_path)
|
self.log.debug("Downloading %s..." % inner_path)
|
||||||
found = self.needFile(inner_path, update=self.bad_files.get(inner_path))
|
found = self.needFile(inner_path, update=self.bad_files.get(inner_path))
|
||||||
content_inner_dir = helper.getDirname(inner_path)
|
content_inner_dir = helper.getDirname(inner_path)
|
||||||
|
@ -151,15 +152,19 @@ class Site(object):
|
||||||
include_thread = gevent.spawn(self.downloadContent, file_inner_path, download_files=download_files, peer=peer)
|
include_thread = gevent.spawn(self.downloadContent, file_inner_path, download_files=download_files, peer=peer)
|
||||||
include_threads.append(include_thread)
|
include_threads.append(include_thread)
|
||||||
|
|
||||||
|
if config.verbose:
|
||||||
self.log.debug("%s: Downloading %s includes..." % (inner_path, len(include_threads)))
|
self.log.debug("%s: Downloading %s includes..." % (inner_path, len(include_threads)))
|
||||||
gevent.joinall(include_threads)
|
gevent.joinall(include_threads)
|
||||||
|
if config.verbose:
|
||||||
self.log.debug("%s: Includes download ended" % inner_path)
|
self.log.debug("%s: Includes download ended" % inner_path)
|
||||||
|
|
||||||
if check_modifications: # Check if every file is up-to-date
|
if check_modifications: # Check if every file is up-to-date
|
||||||
self.checkModifications(0)
|
self.checkModifications(0)
|
||||||
|
|
||||||
|
if config.verbose:
|
||||||
self.log.debug("%s: Downloading %s files, changed: %s..." % (inner_path, len(file_threads), len(changed)))
|
self.log.debug("%s: Downloading %s files, changed: %s..." % (inner_path, len(file_threads), len(changed)))
|
||||||
gevent.joinall(file_threads)
|
gevent.joinall(file_threads)
|
||||||
|
if config.verbose:
|
||||||
self.log.debug("%s: DownloadContent ended in %.2fs" % (inner_path, time.time() - s))
|
self.log.debug("%s: DownloadContent ended in %.2fs" % (inner_path, time.time() - s))
|
||||||
|
|
||||||
if not self.worker_manager.tasks:
|
if not self.worker_manager.tasks:
|
||||||
|
|
Loading…
Reference in a new issue