diff --git a/aiogram/contrib/fsm_storage/rethinkdb.py b/aiogram/contrib/fsm_storage/rethinkdb.py index 9aeef13f..f49eab12 100644 --- a/aiogram/contrib/fsm_storage/rethinkdb.py +++ b/aiogram/contrib/fsm_storage/rethinkdb.py @@ -103,17 +103,15 @@ class RethinkDBStorage(BaseStorage): async def wait_closed(self): """ - Checks if connection is closed. + Does nothing """ - if len(self._outstanding_connections) != 0 and self._queue.qsize() != 0: - raise ConnectionNotClosed - return True + await asyncio.sleep(0) async def get_state(self, *, chat: typing.Union[str, int, None] = None, user: typing.Union[str, int, None] = None, default: typing.Optional[str] = None) -> typing.Optional[str]: chat, user = map(str, self.check_address(chat=chat, user=user)) conn = await self.get_connection() - result = await r.table(self._table).get(chat)[user]['state'].default(default or '').run(conn) + result = await r.table(self._table).get(chat)[user]['state'].default(default or None).run(conn) await self.put_connection(conn) return result or None