Skip to content

Commit

Permalink
Improved logs
Browse files Browse the repository at this point in the history
Signed-off-by: Cédric Foellmi <[email protected]>
  • Loading branch information
onekiloparsec committed Apr 13, 2024
1 parent b6df897 commit 873b2d8
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions arcsecond/uploader/walker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import time
from collections import Counter
from pathlib import Path

Expand All @@ -20,9 +19,6 @@ def __walk_first_pass(context: Context, root_path: Path):
logger = get_oort_logger()
log_prefix = '[Walker - 1/2]'
logger.info(f"{log_prefix} Making a first pass to collect info on files...")
if context.config.api_name != 'dev':
# For user experience, and let him/her read the above message.
time.sleep(3)

total_file_count = sum(1 for f in root_path.glob('**/*') if f.is_file() and not is_file_hidden(f))

Expand All @@ -47,16 +43,14 @@ def __walk_second_pass(context: Context, root_path: Path, file_paths: list):
logger = get_oort_logger()
log_prefix = '[Walker - 2/2]'
logger.info(f"{log_prefix} Starting second pass to upload files...")
if context.config.api_name != 'dev':
time.sleep(3)

uploads = {'succeeded': [], 'skipped': [], 'failed': []}
total_file_count = len(file_paths)

index = 0
for file_path in file_paths:
index += 1
click.echo(f"\n{log_prefix} File {index} / {total_file_count} ({index / total_file_count * 100:.2f}%)\n")
click.echo(f"{log_prefix} File {index} / {total_file_count} ({index / total_file_count * 100:.2f}%)")

uploader = FileUploader(context, root_path, file_path, display_progress=True)
status, substatus, error = uploader.upload_file()
Expand Down

0 comments on commit 873b2d8

Please sign in to comment.