Use wait just this once

This commit is contained in:
Daniil Gentili 2020-10-06 11:11:49 +02:00
parent 9511ebab38
commit ba59131926
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -615,7 +615,7 @@ class MTProto extends AsyncConstruct implements TLCallback
{ {
$db = $this->settings->getDb(); $db = $this->settings->getDb();
if ($db instanceof Memory && $db->getCleanup()) { if ($db instanceof Memory && $db->getCleanup()) {
$this->cleanup(); Tools::wait($this->cleanup());
} }
$res = [ $res = [
// Databases // Databases
@ -689,9 +689,9 @@ class MTProto extends AsyncConstruct implements TLCallback
/** /**
* Cleanup memory and session file. * Cleanup memory and session file.
* *
* @return void * @return \Generator
*/ */
public function cleanup(): void public function cleanup(): \Generator
{ {
$this->referenceDatabase = new ReferenceDatabase($this); $this->referenceDatabase = new ReferenceDatabase($this);
yield from $this->referenceDatabase->init(); yield from $this->referenceDatabase->init();