fix: room_store __db name mangling + add singleton

This commit is contained in:
2026-05-02 16:07:16 +08:00
parent d3b5499896
commit 56b56e4e85

View File

@@ -102,7 +102,7 @@ class RoomStore:
async def load_rooms(self): async def load_rooms(self):
"""Restore active rooms from DB snapshots on startup.""" """Restore active rooms from DB snapshots on startup."""
await self.ensure_initialized() await self.ensure_initialized()
db = await self.__db if self._db else await self._get_db() db = await self._get_db()
cursor = await db.execute( cursor = await db.execute(
"SELECT scope, state, created_at, horses, bets, champion_name, tick_count FROM room_snapshots" "SELECT scope, state, created_at, horses, bets, champion_name, tick_count FROM room_snapshots"
) )