mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-23 00:51:12 +01:00
Avoid reference database issues
This commit is contained in:
parent
654e8dc87d
commit
9cff1376bb
@ -711,10 +711,6 @@ final class MTProto implements TLCallback, LoggerGetter
|
||||
*/
|
||||
public function __sleep(): array
|
||||
{
|
||||
$db = $this->settings->getDb();
|
||||
if ($db instanceof Memory && $db->getCleanup()) {
|
||||
$this->cleanup();
|
||||
}
|
||||
$res = [
|
||||
// Databases
|
||||
'chats',
|
||||
@ -790,24 +786,6 @@ final class MTProto implements TLCallback, LoggerGetter
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup memory and session file.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function cleanup(): void
|
||||
{
|
||||
$this->referenceDatabase = new ReferenceDatabase($this);
|
||||
$callbacks = [$this];
|
||||
if ($this->settings->getDb()->getEnableFileReferenceDb()) {
|
||||
$callbacks[] = $this->referenceDatabase;
|
||||
}
|
||||
if ($this->settings->getDb()->getEnableMinDb() && !($this->authorization['user']['bot'] ?? false)) {
|
||||
$callbacks[] = $this->minDatabase;
|
||||
}
|
||||
$this->TL->updateCallbacks($callbacks);
|
||||
}
|
||||
|
||||
private function fillUsernamesCache(): void
|
||||
{
|
||||
if (!$this->settings->getDb()->getEnableUsernameDb()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user