mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-23 03:31:17 +01:00
Small fix
This commit is contained in:
parent
78e15f0c9a
commit
f3733fa40c
@ -40,7 +40,7 @@ class PingLoop extends ResumableSignalLoop
|
||||
$datacenter = $this->datacenter;
|
||||
$connection = $this->connection;
|
||||
$shared = $this->datacenterConnection;
|
||||
$timeout = $shared->getSettings()->getTimeout();
|
||||
$timeout = $shared->getSettings()->getPingInterval();
|
||||
$timeoutMs = $timeout * 1000;
|
||||
while (true) {
|
||||
while (!$shared->hasTempAuthKey()) {
|
||||
@ -51,7 +51,7 @@ class PingLoop extends ResumableSignalLoop
|
||||
if (yield $this->waitSignal($this->pause($timeoutMs))) {
|
||||
return;
|
||||
}
|
||||
if (\time() - $connection->getLastChunk() >= $timeout) {
|
||||
if (\time() - $connection->getLastChunk() >= $timeout && $shared->hasTempAuthKey()) {
|
||||
$API->logger->logger("Ping DC {$datacenter}");
|
||||
try {
|
||||
yield from $connection->methodCallAsyncRead('ping', ['ping_id' => \random_bytes(8)]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user