Fix floodWait management
This commit is contained in:
parent
73384f0bb4
commit
a9bf26c9c0
@ -383,7 +383,10 @@ trait ResponseHandler
|
||||
$limit = $request->getFloodWaitLimit() ?? $this->API->settings->getRPC()->getFloodTimeout();
|
||||
if (\is_numeric($seconds) && $seconds < $limit) {
|
||||
$this->logger->logger("Flood, waiting $seconds seconds before repeating async call of $request...", Logger::NOTICE);
|
||||
$this->gotResponseForOutgoingMessage($request);
|
||||
$request->setSent(($request->getSent() ?? \time()) + $seconds);
|
||||
$request->setMsgId(null);
|
||||
$request->setSeqNo(null);
|
||||
Loop::delay($seconds * 1000, [$this, 'methodRecall'], ['message_id' => $request->getMsgId()]);
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user