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:
parent
4de97c29b0
commit
9bbb72f12b
@ -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)) {
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user