Pass args.log_json to FilesystemObjectProcessors/Statistics instance

This commit is contained in:
Manu 2021-02-07 10:42:46 +08:00
parent 940768ef2a
commit a84ead8e7c
2 changed files with 5 additions and 3 deletions

View File

@ -1200,7 +1200,8 @@ class FilesystemObjectProcessors:
def __init__(self, *, metadata_collector, cache, key,
add_item, process_file_chunks,
chunker_params, show_progress, sparse):
chunker_params, show_progress, sparse,
log_json):
self.metadata_collector = metadata_collector
self.cache = cache
self.key = key
@ -1209,7 +1210,7 @@ class FilesystemObjectProcessors:
self.show_progress = show_progress
self.hard_links = {}
self.stats = Statistics() # threading: done by cache (including progress)
self.stats = Statistics(output_json=log_json) # threading: done by cache (including progress)
self.cwd = os.getcwd()
self.chunker = get_chunker(*chunker_params, seed=key.chunk_seed, sparse=sparse)

View File

@ -657,7 +657,8 @@ class Archiver:
checkpoint_interval=args.checkpoint_interval, rechunkify=False)
fso = FilesystemObjectProcessors(metadata_collector=metadata_collector, cache=cache, key=key,
process_file_chunks=cp.process_file_chunks, add_item=archive.add_item,
chunker_params=args.chunker_params, show_progress=args.progress, sparse=args.sparse)
chunker_params=args.chunker_params, show_progress=args.progress, sparse=args.sparse,
log_json=args.log_json)
create_inner(archive, cache, fso)
else:
create_inner(None, None, None)