Skip to content

Commit

Permalink
In worker, skip if no new game logs are present (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaldengeki authored Aug 4, 2024
1 parent a3fefcd commit b3827e4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ark_nova_stats/worker/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ def archive_logs_to_tigris(
)
return None

# Next, check to see if we have new logs to include in the archive.
new_logs = GameLog.query.where(
GameLog.id > last_archive.last_game_log_id
).count()
if new_logs == 0:
logger.debug(
f"No new logs to include since game ID {last_archive.last_game_log_id}; skipping."
)
return None

# Retrieve all the game logs so we can serialize them.
all_logs: list[GameLog] = GameLog.query.all()
users: set[str] = set()
Expand Down

0 comments on commit b3827e4

Please sign in to comment.