Skip to content

Commit

Permalink
changes logging slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
David Erb committed Jun 21, 2023
1 parent c40e828 commit 7bf5ac9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/dls_normsql/aiomysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,15 @@ async def disconnect(self):

if self.__connection is not None:
# Commit final transaction if not currently autocommitting.
if not self.__connection.get_autocommit():
logger.debug(f"[DISSHU] {callsign(self)} committing final transaction")
try:
await self.__connection.commit()
logger.debug(
f"[DISSHU] {callsign(self)} successfully committed final transaction"
)
except Exception as exception:
logger.warning(
callsign(self, explain(exception, "committing final transaction"))
)
logger.debug(f"[DISSHU] {callsign(self)} closing connection to server")
self.__connection.close()
self.__connection = None
Expand Down

0 comments on commit 7bf5ac9

Please sign in to comment.