mirror of
https://github.com/masterking32/MasterHttpRelayVPN.git
synced 2026-05-17 21:24:37 +03:00
feat: improve task cancellation and error logging in DomainFronter
This commit is contained in:
@@ -310,6 +310,12 @@ async def _run(config):
|
||||
await server.start()
|
||||
finally:
|
||||
await server.stop()
|
||||
# Cancel any tasks that leaked through (e.g. fire-and-forget pool tasks).
|
||||
stray = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()]
|
||||
for t in stray:
|
||||
t.cancel()
|
||||
if stray:
|
||||
await asyncio.gather(*stray, return_exceptions=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user