We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c40e828 commit 7bf5ac9Copy full SHA for 7bf5ac9
src/dls_normsql/aiomysql.py
@@ -215,9 +215,15 @@ async def disconnect(self):
215
216
if self.__connection is not None:
217
# Commit final transaction if not currently autocommitting.
218
- if not self.__connection.get_autocommit():
219
- logger.debug(f"[DISSHU] {callsign(self)} committing final transaction")
+ try:
220
await self.__connection.commit()
+ logger.debug(
221
+ f"[DISSHU] {callsign(self)} successfully committed final transaction"
222
+ )
223
+ except Exception as exception:
224
+ logger.warning(
225
+ callsign(self, explain(exception, "committing final transaction"))
226
227
logger.debug(f"[DISSHU] {callsign(self)} closing connection to server")
228
self.__connection.close()
229
self.__connection = None
0 commit comments