mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-27 15:14:39 +01:00
Avoid invoking gc_collect_cycles to avoid triggering PHP 8.2.2 bug
This commit is contained in:
parent
aecad0165d
commit
9ee8c00eb9
@ -47,7 +47,7 @@ final class GarbageCollector
|
||||
}
|
||||
self::$started = true;
|
||||
|
||||
EventLoop::unreference(EventLoop::repeat(1, static function (): void {
|
||||
/*EventLoop::unreference(EventLoop::repeat(1, static function (): void {
|
||||
$currentMemory = self::getMemoryConsumption();
|
||||
if ($currentMemory > self::$memoryConsumption + self::$memoryDiffMb) {
|
||||
\gc_collect_cycles();
|
||||
@ -57,7 +57,7 @@ final class GarbageCollector
|
||||
Logger::log("gc_collect_cycles done. Cleaned memory: $cleanedMemory Mb", Logger::VERBOSE);
|
||||
}
|
||||
}
|
||||
}));
|
||||
}));*/
|
||||
|
||||
if (!\defined('MADELINE_RELEASE_URL')) {
|
||||
return;
|
||||
|
@ -28,6 +28,7 @@ use danog\MadelineProto\MTProto;
|
||||
use danog\MadelineProto\MTProto\OutgoingMessage;
|
||||
use danog\MadelineProto\TL\TLCallback;
|
||||
use danog\MadelineProto\Tools;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
/**
|
||||
* Manages upload and download of files.
|
||||
@ -489,6 +490,10 @@ final class ReferenceDatabase implements TLCallback
|
||||
if (!isset($this->db[$locationString]['reference'])) {
|
||||
if (isset($location['file_reference'])) {
|
||||
$this->API->logger->logger("Using outdated file reference for location of type {$locationType} object {$location['_']}", Logger::ULTRA_VERBOSE);
|
||||
if (is_array($location['file_reference'])) {
|
||||
Assert::eq($location['file_reference']['_'], 'bytes');
|
||||
return base64_decode($location['file_reference']['bytes'], true);
|
||||
}
|
||||
return (string) $location['file_reference'];
|
||||
}
|
||||
if (!$this->refresh) {
|
||||
|
Loading…
Reference in New Issue
Block a user