Skip to content

Commit

Permalink
added handler to prevent errors during waypoint upsert with closed co…
Browse files Browse the repository at this point in the history
…nnections
  • Loading branch information
Ctri-The-Third committed Oct 22, 2023
1 parent b238706 commit e65ffb2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion straders_sdk/pg_pieces/upsert_waypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ def _upsert_waypoint(connection, waypoint: Waypoint):
connection.commit()
except Exception as err:
print(err)
connection.rollback()
if connection.closed == 0:
connection.rollback()

0 comments on commit e65ffb2

Please sign in to comment.