Move flood waiting time value to settings (#50)
This commit is contained in:
parent
5751bbca8c
commit
c4735c9a61
@ -193,6 +193,9 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB
|
|||||||
'authorization' => 5, // How many times should I try to generate an authorization key before throwing an exception
|
'authorization' => 5, // How many times should I try to generate an authorization key before throwing an exception
|
||||||
'response' => 5, // How many times should I try to get a response of a query before throwing an exception
|
'response' => 5, // How many times should I try to get a response of a query before throwing an exception
|
||||||
],
|
],
|
||||||
|
'flood_timeout' => [
|
||||||
|
'wait_if_lt' => 20, // Sleeps if flood block time is lower than this
|
||||||
|
],
|
||||||
'msg_array_limit' => [ // How big should be the arrays containing the incoming and outgoing messages?
|
'msg_array_limit' => [ // How big should be the arrays containing the incoming and outgoing messages?
|
||||||
'incoming' => 1000,
|
'incoming' => 1000,
|
||||||
'outgoing' => 1000,
|
'outgoing' => 1000,
|
||||||
|
@ -91,7 +91,7 @@ trait CallHandler
|
|||||||
case 420:
|
case 420:
|
||||||
if ($this->settings['pwr']['pwr']) {
|
if ($this->settings['pwr']['pwr']) {
|
||||||
$seconds = preg_replace('/[^0-9]+/', '', $server_answer['error_message']);
|
$seconds = preg_replace('/[^0-9]+/', '', $server_answer['error_message']);
|
||||||
if (is_numeric($seconds) && $seconds < 20) {
|
if (is_numeric($seconds) && $seconds < $this->settings['flood_timeout']['wait_if_lt']) {
|
||||||
\danog\MadelineProto\Logger::log('Flood, waiting '.$seconds.' seconds...');
|
\danog\MadelineProto\Logger::log('Flood, waiting '.$seconds.' seconds...');
|
||||||
sleep($seconds);
|
sleep($seconds);
|
||||||
throw new \danog\MadelineProto\Exception('Re-executing query...');
|
throw new \danog\MadelineProto\Exception('Re-executing query...');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user