From ba59131926ef7b32690ec595cc9286ee2755926c Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 6 Oct 2020 11:11:49 +0200 Subject: [PATCH] Use wait just this once --- src/danog/MadelineProto/MTProto.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index ad028e98..5f7ff7e0 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -615,7 +615,7 @@ class MTProto extends AsyncConstruct implements TLCallback { $db = $this->settings->getDb(); if ($db instanceof Memory && $db->getCleanup()) { - $this->cleanup(); + Tools::wait($this->cleanup()); } $res = [ // Databases @@ -689,9 +689,9 @@ class MTProto extends AsyncConstruct implements TLCallback /** * Cleanup memory and session file. * - * @return void + * @return \Generator */ - public function cleanup(): void + public function cleanup(): \Generator { $this->referenceDatabase = new ReferenceDatabase($this); yield from $this->referenceDatabase->init();