Skip to content

Commit

Permalink
Also rollback the datanommer session on error
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Jun 7, 2024
1 parent db83d57 commit ef7358b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fedbadges/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ def __call__(self, message: Message):
log.exception("Could not process message %s on %s", message.id, message.topic)
# If we don't rollback, following queryies will fail.
self.tahrir.session.rollback()
datanommer.models.session.rollback()
# Also rollback the connection to avoid https://sqlalche.me/e/20/8s2b
self.tahrir.session.connection().rollback()
datanommer.models.session.connection().rollback()

def _process_message(self, message: Message):
# First thing, we receive the message, but we put ourselves to sleep to
Expand Down

0 comments on commit ef7358b

Please sign in to comment.