ChatCrawlerпоиск по публичному Telegram Открыть приложение
T

Taskiq.py

сообщение · 2026-08-24 16:17 UTC
T
🎉 New Pull Request to taskiq-python/taskiq by @aticie ✨ fix: ValueError "Token was created in a different context" (#661) 📊 +23/-34 🌿 aticie:fix/opentelemetry-context-issues → master Fixes an issue that happens with OpenTelemetryMiddleware when a message is requeued with Context.requeue(). Context.requeue() uses self.broker.kick to kick a message to the broker which skips the Middleware pre-send and post-send invocations that kicker does here: taskiq/taskiq/kicker.py Lines 160 to 162 in ced1909 taskiq/taskiq/kicker.py Lines 168 to 170 in ced1909 Messages that are requeued with the same context variables will raise an error on post_save's .detach() because they are now running in a different async context. The message's lifecycle on OpenTelemetryMiddleware will be: • pre_send -> message.labels are injected with context here • post_send • pre_execute -> message.labels are extracted here and re-used • post_execute • requeue() happens -> skipping pre_send and post_send, therefore not renewing the context. • pre_execute -> context inferred from message.labels again • post_execute • post_save -> Detaching the stale context here. Raises ValueError: Token was created in a different context This change gets rid of post_save on OpenTelemetryMiddleware to detach the context on post_execute instead. Since, we are not actually doing anything database save related on the current post_save method, it seems fair to move everything under post_execute as this is where the task execution actually ends. sent via relator

Все сообщения за 24 августа 2026 · Вся лента · оригинал в Telegram

Открыть в Telegram Каталог площадок Искать в ChatCrawler

Слепок открытой публичной ленты из поискового индекса ChatCrawler — «Google по публичному Telegram»; обновляется по мере обхода площадки. Время — UTC.

Только публичный контент, официальный API Telegram. О проекте · Вопросы · Чего мы не делаем · Убрать страницу из выдачи · Каталог