Files
polymarket-bot/bot
chemavxandClaude Fable 5 02cbfc0b94
CI/CD / build-and-push (push) Successful in 7s
fix(executor): keep strong references to fire-and-forget Telegram notification tasks
asyncio.create_task() results were discarded, and the event loop only holds
a weak reference to running tasks — a pending notification could be
garbage-collected before executing, silently dropping Telegram messages
(documented asyncio pitfall).

Route the three notification call sites (trade_opened, trade_legacy_closed,
trade_closed) through _notify_in_background(), which stores the task in a
module-level set and discards it on completion. Notifications stay
fire-and-forget; no business logic changed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 17:12:03 +00:00
..