Closed urtvs closed 1 year ago
Hi urtvs,
Telegram Bot uses guzzle client to communicate with the Telegram API. You can find the timeouts in the code like:
$timeOut = 30, $isAsyncRequest = false, $connectTimeOut = 10
It is a personal choice to lower the timeouts if needed based on your network infrastructure. It is mostly not a good idea to lower the timeouts. The fact that your PHP scripts are going down is something you have to manage yourself in your codebase. If you use a framework like Laravel you have a multithreaded framework where your application will not 'hang' when 1 user causes a 40 second timeout.
My friend thanks for your answer.
But i get problem again
Uncaught Telegram\Bot\Exceptions\TelegramSDKException: cURL error 28: Operation timed out after 60001 milliseconds with 0 bytes received (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in /..../composer/vendor/irazasyed/telegram-bot-sdk/src/HttpClients/GuzzleHttpClient.php:114
I run CRON job for sending messages. But some time telegram servers goes into time out and number of cron processe accumulate and i 3-5 minutes server is not responging because as i understand there is limitation of running process
So i need to kill sending after 1 minute because cron job starts every minute
For is best solution for my problem? Thanks!
Hi When telegram server have problems your class wait i think by default about 40 sec, so all php scripts are going down.
Is there any way to set up timeout of sending msg?
Thanks a lot!