Skip to content

Commit

Permalink
In Ark worker, log progress when creating archives (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaldengeki authored Sep 4, 2024
1 parent 8a10ef0 commit de4f721
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ark_nova_stats/worker/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,23 @@ def archive_logs_to_tigris(
if not archive_types_to_create:
return []

logger.info(
f"Creating archives for types: {[str(t.archive_type) for t in archive_types_to_create]}"
)
logs_processed = 0

with tempfile.TemporaryDirectory() as tmpdirname:
for archive_type in archive_types_to_create:
archive_type.create_archive_tempfile(tmpdirname)

for game_log in archive_types_to_create[0].game_logs():
logs_processed += 1
for archive_type in archive_types_to_create:
archive_type.process_game_log(game_log)

if logs_processed % 100 == 0:
logger.info(f"Processed {logs_processed} game logs for archive...")

for archive_type in archive_types_to_create:
archive_type.upload_archive()
archives.append(archive_type.record_archive())
Expand Down

0 comments on commit de4f721

Please sign in to comment.