Skip to content

Commit

Permalink
merge in main
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderHott committed Dec 30, 2024
2 parents ff639f8 + f79e00e commit 1d2fd3e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions daily_colab_task/daily_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,9 @@ def main():
team_names = fetch_team_names(cur)
conn.commit()
teams_data = fetch_team_data()

with get_db_connection() as conn, conn.cursor() as cur:
if teams_data:
logging.info(f"[4] got {len(teams_data)} teams")
if teams_data:
logging.info(f"[4] got {len(teams_data)} teams")
with get_db_connection() as conn, conn.cursor() as cur:
for team_name in team_names:
team_data = next(
(
Expand All @@ -511,9 +510,9 @@ def main():
update_team_stats(team_name, team_data, cur)
else:
print(f"Skipping update for {team_name} (not found in API)")
else:
logging.warning("[4] no team data available")
conn.commit()
conn.commit()
else:
logging.warning("[4] no team data available")
except Exception as e:
logging.error(f"[4] error:\n{format_exception(e)}")

Expand Down

0 comments on commit 1d2fd3e

Please sign in to comment.