I just wanna wait somewhere else

This commit is contained in:
Casey 2024-07-07 21:35:41 +03:00
parent a525018fb1
commit 557ff002b0
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 3 additions and 2 deletions

View File

@ -239,12 +239,13 @@ class AsyncBotManager:
delay: float = 0.25, delay: float = 0.25,
): ):
proxy = ProxyConnector.from_url(proxy_url) if proxy_url else None proxy = ProxyConnector.from_url(proxy_url) if proxy_url else None
await self.ready_event.wait()
try: try:
async with ClientSession(connector=proxy, timeout=TIMEOUT) as http: async with ClientSession(connector=proxy, timeout=TIMEOUT) as http:
async with AsyncSimpleClient(http_session=http) as sio: async with AsyncSimpleClient(http_session=http) as sio:
await sio.connect(f"{self.base}/socket.io") await sio.connect(f"{self.base}/socket.io")
print(f"Writer {bot_index} connected") print(f"Writer {bot_index} connected, waiting...")
await self.ready_event.wait()
print(f"Writer {bot_index} running")
offset = 0 offset = 0
while not self._shutdown: while not self._shutdown:
diff = list(self.difference.items()) diff = list(self.difference.items())