Add in soft failure for sql delete

This commit is contained in:
Brian Read 2024-06-28 10:41:04 +01:00
parent 6cb877d358
commit c5a708a382

View File

@ -757,6 +757,7 @@ if __name__ == "__main__":
""")
# and prune the DB here if needed.
# Delete existing records for the given date
try:
delete_query = """
DELETE FROM SummaryLogs
WHERE Date = %s
@ -768,6 +769,8 @@ if __name__ == "__main__":
#quit()
if rows_deleted > 0:
print(f"Deleted {rows_deleted} rows for {analysis_date} ")
except mysql.connector.Error as e:
print(f"SQL Delete failed ({delete_query}) ({e}) ")
except mysql.connector.Error as e:
print(f"Unable to connect to {DBName} on {DBHost} port {DBPort} error ({e}) ")
saveData = False