1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-22 21:51:34 +01:00

Simplify gap handling after simplification of actor library

This commit is contained in:
Daniil Gentili 2023-12-13 19:57:09 +01:00
parent 4de97c29b0
commit 9bbb72f12b
2 changed files with 4 additions and 8 deletions

View File

@ -112,7 +112,7 @@ final class FeedLoop extends Loop
continue;
}
if (isset($update['pts'], $update['pts_count'])) {
$logger = function ($msg) use ($update): void {
$logger = function (string $msg) use ($update): void {
$pts_count = $update['pts_count'];
$mid = $update['message']['id'] ?? '-';
$mypts = $this->state->pts();
@ -128,8 +128,7 @@ final class FeedLoop extends Loop
$logger('PTS hole');
$this->updater->setLimit($this->state->pts() + $result);
$this->updater->resume();
$updates = array_merge($this->incomingUpdates, $updates);
$this->incomingUpdates = [];
// Drop current update, it will be recovered anyway while filling the gap
continue;
}
if (isset($update['message']['id'], $update['message']['peer_id']) && !\in_array($update['_'], ['updateEditMessage', 'updateEditChannelMessage', 'updateMessageID'], true)) {

View File

@ -94,11 +94,8 @@ final class SeqLoop extends Loop
$result = $this->state->checkSeq($seq_start);
if ($result > 0) {
$this->API->logger('Seq hole. seq_start: '.$seq_start.' != cur seq: '.($this->state->seq() + 1), Logger::ERROR);
delay(1);
if (!$this->incomingUpdates) {
$this->API->updaters[UpdateLoop::GENERIC]->resume();
}
$this->incomingUpdates = array_merge($this->incomingUpdates, [$update], $updates);
$this->API->updaters[UpdateLoop::GENERIC]->resume();
// Drop current update, it will be recovered anyway while filling the gap
continue;
}
if ($result < 0) {