update refactoring and add new features

This commit is contained in:
2026-07-24 20:55:58 -07:00
parent 7f12bc7f40
commit 03fbbbcf28
69 changed files with 16332 additions and 17600 deletions
+12 -1
View File
@@ -319,7 +319,7 @@ class Telegram(Provider):
def _run_async_blocking(self, coro):
"""Run an awaitable to completion using a fresh event loop.
If an event loop is already running in this thread (common in REPL/TUI),
If an event loop is already running in this thread (common in REPL),
runs the coroutine in a worker thread with its own loop.
"""
result: Dict[str,
@@ -358,6 +358,13 @@ class Telegram(Provider):
except Exception:
pass
finally:
try:
try:
loop.run_until_complete(loop.shutdown_default_executor())
except Exception:
pass
except Exception:
pass
try:
loop.close()
except Exception:
@@ -559,6 +566,10 @@ class Telegram(Provider):
asyncio.set_event_loop(loop)
loop.run_until_complete(_auth_async())
finally:
try:
loop.run_until_complete(loop.shutdown_default_executor())
except Exception:
pass
try:
loop.close()
except Exception: