fix: retry only HLTB misses and show progress
CI / test (push) Successful in 24s

This commit is contained in:
strsv committed 2026-11-07 00:27:41 +03:00
1 parent 5874ffba9f
commit e82d0e0f0a
4 files changed
+25 -8

No files matched your search

+11 -3
View File
@@ -116,7 +116,7 @@ def main():
where = ["LOWER(type) = 'game'"]
if not args.refresh:
if args.retry_missed:
where.append("(hltb_checked_at IS NULL OR hltb_match = 0)")
where.append("hltb_match = 0 AND hltb_checked_at IS NOT NULL")
else:
where.append("hltb_checked_at IS NULL")
sql = (f"SELECT appid, name, release_date FROM games WHERE {' AND '.join(where)} "
@@ -158,7 +158,9 @@ def main():
WHERE appid = ?""", (now, row["appid"]))
con.commit()
time.sleep(args.delay)
if index % 20 == 0 or index == len(rows):
if len(rows) <= 20:
print(f" {row['name']}: не найдено")
if index % 10 == 0 or index == len(rows) or len(rows) <= 20:
print(f" {index}/{len(rows)} matched={matched} missing={missing} errors={errors}")
continue
@@ -176,6 +178,10 @@ def main():
WHERE appid = ?""", (now, row["appid"]))
con.commit()
time.sleep(args.delay)
if len(rows) <= 20:
print(f" {row['name']}: нет времени")
if len(rows) <= 20:
print(f" {index}/{len(rows)} matched={matched} missing={missing} errors={errors}")
continue
matched += 1
if not args.dry_run:
@@ -187,7 +193,9 @@ def main():
(main_hours, extra_hours, complete_hours,
getattr(entry, "game_id", None), now, now, best, row["appid"]))
con.commit()
if index % 10 == 0 or index == len(rows):
if len(rows) <= 20:
print(f" {row['name']}: {best} ч")
if index % 10 == 0 or index == len(rows) or len(rows) <= 20:
print(f" {index}/{len(rows)} matched={matched} missing={missing} errors={errors}")
time.sleep(args.delay)