Skip to content

Commit

Permalink
add logging message to explain why rows are being removed
Browse files Browse the repository at this point in the history
  • Loading branch information
vpchung committed Feb 21, 2025
1 parent bceb261 commit 0a4104f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,21 @@ def lambda_handler(event, context) -> dict:
)

if rows_to_remove_from_challenge_service:
logging.warning(
f"Mismatch found in the `challenge_contribution` tables; removing extra rows from "
"the `challenge_service` database"
)
conn = db_utils.connect_to_db()
db_utils.delete_rows_by_id(
conn, "challenge_contribution", rows_to_remove_from_challenge_service
)
conn.close()

if rows_to_remove_from_organization_service:
logging.warning(
f"Mismatch found in the `challenge_contribution` tables; removing extra rows from "
"the `organization_service` database"
)
conn = db_utils.connect_to_db("organization_service")
db_utils.delete_rows_by_id(
conn, "challenge_contribution", rows_to_remove_from_organization_service
Expand Down
2 changes: 1 addition & 1 deletion apps/openchallenges/data-lambda/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0a4104f

Please sign in to comment.