Wait for RPC connection before sending notice to log back in
This commit is contained in:
parent
20bdbf9cd1
commit
8da7f1efbd
@ -109,6 +109,10 @@ class Client:
|
|||||||
await cls._rpc_client.connect()
|
await cls._rpc_client.connect()
|
||||||
await cls._rpc_client.wait_for_disconnection()
|
await cls._rpc_client.wait_for_disconnection()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def wait_for_connection(cls) -> Awaitable[None]:
|
||||||
|
return cls._rpc_client.wait_for_connection()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def stop_cls(cls) -> None:
|
def stop_cls(cls) -> None:
|
||||||
"""Stop and disconnect from the Node backend."""
|
"""Stop and disconnect from the Node backend."""
|
||||||
|
@ -388,6 +388,9 @@ class User(DBUser, BaseUser):
|
|||||||
) -> None:
|
) -> None:
|
||||||
try:
|
try:
|
||||||
if not await self._load_session(is_startup=is_startup) and self.has_state:
|
if not await self._load_session(is_startup=is_startup) and self.has_state:
|
||||||
|
self.log.debug("reload_session failure: wait for connection to Node module before prompting for manual login")
|
||||||
|
await Client.wait_for_connection()
|
||||||
|
self.log.debug("reload_session failure: now connected to Node module")
|
||||||
await self.send_bridge_notice(
|
await self.send_bridge_notice(
|
||||||
"Logged out of KakaoTalk. Must use the `login` command to log back in.",
|
"Logged out of KakaoTalk. Must use the `login` command to log back in.",
|
||||||
important=True,
|
important=True,
|
||||||
|
Loading…
Reference in New Issue
Block a user