Skip to content

Commit

Permalink
Do not refresh full info, just expire the TTL
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Dec 16, 2023
1 parent 831b458 commit 26e93de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ final class API extends AbstractAPI
*
* @var string
*/
public const RELEASE = '8.0.0-beta179';
public const RELEASE = '8.0.0-beta180';
/**
* We're not logged in.
*
Expand Down
9 changes: 6 additions & 3 deletions src/MTProtoTools/UpdateHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
use danog\MadelineProto\ParseMode;
use danog\MadelineProto\PeerNotInDbException;
use danog\MadelineProto\ResponseException;
use danog\MadelineProto\RPCError\FloodWaitError;
use danog\MadelineProto\RPCErrorException;
use danog\MadelineProto\Settings;
use danog\MadelineProto\TL\TL;
Expand Down Expand Up @@ -1056,12 +1057,14 @@ public function saveUpdate(array $update): void
)
) {
try {
$id = $this->getIdInternal($update);
\assert($id !== null);
$this->refreshPeerCache($id);
if ($this->getSettings()->getDb()->getEnableFullPeerDb()) {
$this->refreshFullPeerCache($update);
} else {
$this->refreshPeerCache($update);
$this->peerDatabase->expireFull($id);
}
} catch (PeerNotInDbException) {
} catch (FloodWaitError) {
} catch (RPCErrorException $e) {
if ($e->rpc !== 'CHANNEL_PRIVATE' && $e->rpc !== 'MSG_ID_INVALID') {
throw $e;
Expand Down

0 comments on commit 26e93de

Please sign in to comment.