1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 10:38:59 +01:00

Improve logic

This commit is contained in:
Daniil Gentili 2023-06-16 14:27:36 +02:00
parent b6ecffaf4d
commit 42ecf91720
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -308,7 +308,8 @@ trait ResponseHandler
$this->methodRecall(['message_id' => $request->getMsgId(), 'postpone' => true]);
return null;
}
if ($response['error_code'] === -503 || \in_array($response['error_message'], ['MSGID_DECREASE_RETRY', 'HISTORY_GET_FAILED', 'RPC_CONNECT_FAILED', 'RPC_CALL_FAIL', 'RPC_MCGET_FAIL', 'PERSISTENT_TIMESTAMP_OUTDATED', 'RPC_MCGET_FAIL', 'no workers running', 'No workers running', '-503'])) {
if ((($response['error_code'] === -503 || $response['error_message'] === '-503') && !\in_array($request->getConstructor(), ['messages.getBotCallbackAnswer', 'messages.getInlineBotResults'], true))
|| (\in_array($response['error_message'], ['MSGID_DECREASE_RETRY', 'HISTORY_GET_FAILED', 'RPC_CONNECT_FAILED', 'RPC_CALL_FAIL', 'RPC_MCGET_FAIL', 'PERSISTENT_TIMESTAMP_OUTDATED', 'RPC_MCGET_FAIL', 'no workers running', 'No workers running']))) {
EventLoop::delay(1.0, fn () => $this->methodRecall(['message_id' => $request->getMsgId()]));
return null;
}