This commit is contained in:
NotSoToothless
2026-06-18 02:39:21 -07:00
committed by GitHub
parent 32e747212f
commit d490c1c8d5
4 changed files with 41 additions and 11 deletions
+4 -3
View File
@@ -13,7 +13,7 @@ ROOT = pathlib.Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT))
sys.path.insert(0, str(ROOT.parent / "SHARED"))
from BOT.match_logs import build_match_logs, upsert_match_logs, MATCH_LOGS_SQL
from BOT.match_logs import build_event_log, build_match_logs, upsert_match_logs, MATCH_LOGS_SQL
from BOT.storage import TSS_BATTLES_DB_PATH
REPLAYS = pathlib.Path(os.environ["STORAGE_VOL_PATH"]) / "REPLAYS" / "TSS"
@@ -36,10 +36,11 @@ async def main(dry_run: bool) -> None:
print(f" skip {sid}: {exc}")
continue
chat, battle = build_match_logs(game)
event_log = build_event_log(game)
if dry_run:
print(f" {sid}: chat={len(chat)} battle={len(battle)}")
print(f" {sid}: chat={len(chat)} battle={len(battle)} kills={len(event_log.get('kills') or [])}")
else:
await upsert_match_logs(TSS_BATTLES_DB_PATH, sid, chat, battle)
await upsert_match_logs(TSS_BATTLES_DB_PATH, sid, chat, battle, event_log)
done += 1
print(f"{'Would backfill' if dry_run else 'Backfilled'} "
f"{len(files) if dry_run else done} sessions")