This commit is contained in:
yumoqing 2026-04-14 10:38:05 +08:00
parent aedab9abff
commit 0859f8162d

View File

@ -137,13 +137,13 @@ class DBPools:
self._pools[name] = pool self._pools[name] = pool
self.e_except = None self.e_except = None
sqlor = None sqlor = None
try:
async with pool.context() as sqlor: async with pool.context() as sqlor:
try:
await sqlor.enter() await sqlor.enter()
yield sqlor yield sqlor
await sqlor.exit()
if sqlor and sqlor.dataChanged: if sqlor and sqlor.dataChanged:
await sqlor.commit() await sqlor.commit()
await sqlor.exit()
except Exception as e: except Exception as e:
self.e_except = e self.e_except = e
cb = format_exc() cb = format_exc()