fix: resolve 4 logic bugs found in code review
- utc_to_eastern: use zoneinfo instead of hardcoded EDT offset (-4) so start times are correct in both EST and EDT - standings: fetch before truncate so a failed API call doesn't wipe existing standings data - routes: call parse_games() once per request instead of three times - scheduler: wrap run_pending() in try/except so an unhandled exception doesn't kill the background thread Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -67,8 +67,8 @@ def fetch_standings():
|
||||
def refresh_standings():
|
||||
conn = sqlite3.connect(DB_PATH)
|
||||
create_standings_table(conn)
|
||||
truncate_standings_table(conn)
|
||||
standings = fetch_standings()
|
||||
if standings:
|
||||
truncate_standings_table(conn)
|
||||
insert_standings(conn, standings)
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user