mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
The old stop only set an atomic flag checked between jobs: a worker blocked in recv() never woke (the channel was never closed), and queued jobs were neither drained nor abandoned in a defined way despite the "drains up to 256 jobs" comment. Now stop_url_workers sets the flag, drops the sender so blocked recv() calls wake with None, and awaits the worker JoinHandles (each finishes its in-flight job first). main awaits it inside the existing 30s shutdown timeout.