chore(db): remove patch for aiosqlite in init_db function

This commit is contained in:
shiyu
2025-12-25 15:49:53 +08:00
parent ff1c06ad18
commit 09c65bffb7

View File

@@ -12,22 +12,7 @@ TORTOISE_ORM = {
},
}
def patch_aiosqlite_for_tortoise() -> None:
import aiosqlite
if hasattr(aiosqlite.Connection, "start"):
return
def start(self) -> None: # type: ignore[no-redef]
if not self._thread.is_alive():
self._thread.start()
aiosqlite.Connection.start = start # type: ignore[attr-defined]
async def init_db():
patch_aiosqlite_for_tortoise()
await Tortoise.init(config=TORTOISE_ORM)
await Tortoise.generate_schemas()
await runtime_registry.refresh()