fix irc
This commit is contained in:
@@ -183,6 +183,8 @@ class TwitchIRCClient:
|
||||
logger.info(f"⏸️ #{self.channel} waiting for resume before connecting...")
|
||||
while is_active and not is_active():
|
||||
await asyncio.sleep(2)
|
||||
if not is_active and not is_active():
|
||||
return stats
|
||||
logger.info(f"▶️ #{self.channel} resumed, connecting to IRC")
|
||||
|
||||
if not await self.connect():
|
||||
@@ -265,7 +267,9 @@ class TwitchIRCClient:
|
||||
# Читаем строку
|
||||
try:
|
||||
line = await asyncio.wait_for(self._read_line(), timeout=5.0)
|
||||
except (asyncio.TimeoutError, asyncio.CancelledError):
|
||||
except asyncio.CancelledError:
|
||||
raise
|
||||
except asyncio.TimeoutError:
|
||||
continue
|
||||
except Exception as e:
|
||||
logger.warning(f"IRC read error: {e}")
|
||||
@@ -291,7 +295,9 @@ class TwitchIRCClient:
|
||||
stats["links_found"] += 1
|
||||
try:
|
||||
await on_url_found(url, msg['display_name'])
|
||||
except:
|
||||
except asyncio.CancelledError:
|
||||
raise
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return stats
|
||||
|
||||
Reference in New Issue
Block a user