mirror of
https://github.com/danog/MadelineProto.git
synced 2024-12-02 09:57:47 +01:00
Cleanup timeout logic
This commit is contained in:
parent
aba85f8dd9
commit
63e357696b
2
docs
2
docs
@ -1 +1 @@
|
|||||||
Subproject commit 851eccfc27aaa54c068512f59a6c68e0dbbbe014
|
Subproject commit 810ac91d86265f114a736222b7bf0b7c5115f878
|
@ -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);
|
$difference = $this->API->methodCallAsyncRead('updates.getDifference', ['pts' => $state->pts(), 'date' => $state->date(), 'qts' => $state->qts()], $this->API->authorized_dc);
|
||||||
break;
|
break;
|
||||||
} catch (TimeoutError) {
|
} catch (TimeoutError) {
|
||||||
|
delay(1.0);
|
||||||
} catch (TimeoutException) {
|
} catch (TimeoutException) {
|
||||||
EventLoop::queue($this->API->report(...), "Network issues detected, please check logs!");
|
EventLoop::queue($this->API->report(...), "Network issues detected, please check logs!");
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
} while (true);
|
} while (true);
|
||||||
$this->API->logger('Got '.$difference['_'], Logger::ULTRA_VERBOSE);
|
$this->API->logger('Got '.$difference['_'], Logger::ULTRA_VERBOSE);
|
||||||
|
@ -18,10 +18,13 @@
|
|||||||
|
|
||||||
namespace danog\MadelineProto\RPCError;
|
namespace danog\MadelineProto\RPCError;
|
||||||
|
|
||||||
|
use Amp\TimeoutException;
|
||||||
use danog\MadelineProto\RPCErrorException;
|
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
|
final class TimeoutError extends RPCErrorException
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user