Skip to content

Fix async retry - #2630

Merged
Badiboy merged 2 commits into
eternnoir:masterfrom
Badiboy:chatgpt
Sep 19, 2026
Merged

Badiboy merged 2 commits into
eternnoir:masterfrom
Badiboy:chatgpt

Conversation

@Badiboy

@Badiboy Badiboy commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix async retry (#2599)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Multipart uploads cannot reuse the same one-shot FormData across retry attempts.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds opt-in retry handling for transient async Telegram API failures.

Changes:

  • Adds retry configuration matching the synchronous helper.
  • Retries aiohttp errors and timeouts before raising RequestTimeout.
File summaries
File Description
telebot/asyncio_helper.py Implements configurable async request retries.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread telebot/asyncio_helper.py Outdated
Comment thread telebot/asyncio_helper.py
Comment thread telebot/asyncio_helper.py
REQUEST_TIMEOUT = 300
MAX_RETRIES = 3
RETRY_ON_ERROR = False
RETRY_TIMEOUT = 2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retry_delay?

@coder2020official

Copy link
Copy Markdown
Collaborator

looks good i guess

Comment thread telebot/asyncio_helper.py Outdated
MAX_RETRIES = 3
RETRY_ON_ERROR = False
RETRY_TIMEOUT = 2
MAX_RETRIES = 15

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we need 15 max retries though

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this equal to SYNC version. Both for naming and values.
Naming better to keep, but values may be set as you wish. May change both to 3.

@coder2020official

Copy link
Copy Markdown
Collaborator

3 should be fine yeah for max_retries

@Badiboy

Badiboy commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator Author

Done?

@coder2020official

Copy link
Copy Markdown
Collaborator

yes

@Badiboy

Badiboy commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator Author

Thnx. I'll test the current version on prod for weekend. If it's ok - release.

@Badiboy
Badiboy merged commit 115464b into eternnoir:master Sep 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants