-
Notifications
You must be signed in to change notification settings - Fork 2.1k
redesigned the antiflood method for guaranteed message delivery #1947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi! |
|
What is the reason for loop if there is a sleep for all the required time? |
|
the library uses multithreading. another thread manages to squeeze in and send, and part of the threads returns error 429 with a new timeout. my solution guarantees that the message will be sent\modified. |
|
using the previous solution, I still continue to receive 429 errors when sending/changing messages in bulk. this decision corrected the situation |
|
Should be tested first |
|
the original function does not raise an error when the message is not delivered, i don't see any reason for redesigning cuz the previous version already handles 429 error which is the only error to be handled |
|
above I described a case in which the current solution did not work for me, so I changed it to a solution that delivers 100% messages. |
|
But raising the error is a breaking change |
It raised error before. With this update it will raise it more rare. From my side I cannot accept infinite loops in processing. Various things may happen, thus infinite loop will bring to stall. Loop may exist but it should be finite. May be with configurable (by parameter) number of retries. |
e1ec77e to
9e476b9
Compare
|
I added 5 attempts, that should be enough |
9e476b9 to
14294d1
Compare
|
@coder2020official Looks fine for me now. |
|
@Badiboy should the function raise an error when apitelegramexception is thrown? |
|
@coder2020official Reasonable. @alex75311 Please, set in line 628 "raise" instead of "return ...". |
|
if we are talking about line 6 of your screenshot, then this exception is called if the function returned an error other than 429 |
|
Yes, is it intended? Before it never raised an error |
|
look carefully at how it was before |
|
Fine then, I probably skipped the last part |


Description
redesigned the antiflood method for guaranteed message delivery
Checklist: