Fixed ModuleStorage close race by acquiring storage lock.
CI / Formatting (push) Successful in 5s
CI / Linting (push) Successful in 6s
CI / Tests (Python 3.12) (push) Successful in 2m49s
CI / Tests (Python 3.13) (push) Successful in 2m49s
CI / Tests (Python 3.14) (push) Successful in 2m49s
CI / Type Checking (push) Successful in 9s
CI / Spelling (push) Successful in 5s
CD / Publish Package (push) Successful in 9s
CD / Publish Image (push) Successful in 1m29s
CI / Formatting (push) Successful in 5s
CI / Linting (push) Successful in 6s
CI / Tests (Python 3.12) (push) Successful in 2m49s
CI / Tests (Python 3.13) (push) Successful in 2m49s
CI / Tests (Python 3.14) (push) Successful in 2m49s
CI / Type Checking (push) Successful in 9s
CI / Spelling (push) Successful in 5s
CD / Publish Package (push) Successful in 9s
CD / Publish Image (push) Successful in 1m29s
This commit is contained in:
@@ -286,8 +286,9 @@ class ModuleStorage:
|
||||
|
||||
async def _close(self) -> None:
|
||||
"""Close the connection (internal use by bot)."""
|
||||
self._closed = True
|
||||
if self._conn is not None:
|
||||
await self._conn.close()
|
||||
self._conn = None
|
||||
async with self._lock:
|
||||
self._closed = True
|
||||
if self._conn is not None:
|
||||
await self._conn.close()
|
||||
self._conn = None
|
||||
self._logger.info("Connection closed.")
|
||||
|
||||
Reference in New Issue
Block a user