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

Cleanup timeout logic

This commit is contained in:
Daniil Gentili 2024-06-26 18:08:52 +02:00
parent aba85f8dd9
commit 63e357696b
3 changed files with 6 additions and 3 deletions

2
docs

@ -1 +1 @@
Subproject commit 851eccfc27aaa54c068512f59a6c68e0dbbbe014
Subproject commit 810ac91d86265f114a736222b7bf0b7c5115f878

View File

@ -173,9 +173,9 @@ final class UpdateLoop extends Loop
$difference = $this->API->methodCallAsyncRead('updates.getDifference', ['pts' => $state->pts(), 'date' => $state->date(), 'qts' => $state->qts()], $this->API->authorized_dc);
break;
} catch (TimeoutError) {
delay(1.0);
} catch (TimeoutException) {
EventLoop::queue($this->API->report(...), "Network issues detected, please check logs!");
continue;
}
} while (true);
$this->API->logger('Got '.$difference['_'], Logger::ULTRA_VERBOSE);

View File

@ -18,10 +18,13 @@
namespace danog\MadelineProto\RPCError;
use Amp\TimeoutException;
use danog\MadelineProto\RPCErrorException;
/**
* Represents a request timeout RPC error returned by telegram (as opposed to one returned by MadelineProto, which will be an \Amp\TimeoutException).
* Represents a request timeout RPC error returned by telegram (as opposed to one returned by MadelineProto, which will be a {@see TimeoutException}).
*
* @see TimeoutException
*/
final class TimeoutError extends RPCErrorException
{