Repeat the http request on fail by dmikushin · Pull Request #262 · reo7sp/tgbot-cpp · GitHub
Skip to content

Repeat the http request on fail#262

Merged
reo7sp merged 4 commits into
reo7sp:masterfrom
dmikushin:repeat-http-request-on-fail
May 10, 2023
Merged

Repeat the http request on fail#262
reo7sp merged 4 commits into
reo7sp:masterfrom
dmikushin:repeat-http-request-on-fail

Conversation

@dmikushin

Copy link
Copy Markdown
Contributor

I've been using tgbot-cpp in production for half a year, and its most recent execution is already up for 60 days. In order to bring this nice stability, I had to handle periodic outages of network and/or telegram endpoint timeout in a more recoverable way. The thing is currently we throw an exception in case the HTTP request fails. I changed that to repeat request with a timeout until it succeeds. To me it seems a fairly reasonable design, even by default. What do you think?

… is a better design, because Telegram end point sometimes may not respond

@JellyBrick JellyBrick 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.

It seems more like a "hack" than a solution.
Also, I think it's better to leave exception handling to the user.

@dmikushin

Copy link
Copy Markdown
Contributor Author

Comment thread src/Api.cpp Outdated
Comment thread src/Api.cpp Outdated
@dmikushin dmikushin requested a review from reo7sp February 13, 2023 11:05
…opmost in the retry loop, enclosing everything
@dmikushin

Copy link
Copy Markdown
Contributor Author

@reo7sp reo7sp left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks

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