We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12a1b3d commit fc68869Copy full SHA for fc68869
1 file changed
main.py
@@ -119,6 +119,9 @@ async def telegram_webhook(token: str, request: Request):
119
update = telegram.Update.de_json(data=data, bot=application.bot)
120
# Await the processing SYNCHRONOUSLY before returning 200 OK
121
# This prevents Cloud Run from throttling the CPU while the bot is doing work
122
+ # TODO: If user traffic scales significantly and Telegram throws `RetryAfter` for
123
+ # generic `send_message` calls, consider offloading processing or outbound
124
+ # messages to Google Cloud Tasks / PubSub to decouple the HTTP response from the work.
125
await application.process_update(update)
126
except Exception as e:
127
logging.error(f"Failed to process update: {e}")
0 commit comments