From 8b796e0c946ccda03e7b7dc97e5732bea35d37d9 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 8 Dec 2024 19:45:38 +0000 Subject: [PATCH] Improve the speed for blurhash generation --- src/Object/Image.php | 2 +- src/Protocol/ATProtocol/Jetstream.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Object/Image.php b/src/Object/Image.php index 256de2f284..26fc5bac6f 100644 --- a/src/Object/Image.php +++ b/src/Object/Image.php @@ -770,7 +770,7 @@ class Image */ public function getBlurHash(): string { - $image = New Image($this->asString(), $this->getType(), $this->filename, false); + $image = clone($this); if (empty($image) || !$this->isValid()) { return ''; } diff --git a/src/Protocol/ATProtocol/Jetstream.php b/src/Protocol/ATProtocol/Jetstream.php index c1b866dac8..834d6ac5c6 100755 --- a/src/Protocol/ATProtocol/Jetstream.php +++ b/src/Protocol/ATProtocol/Jetstream.php @@ -295,7 +295,7 @@ class Jetstream break; } if (microtime(true) - $timestamp > 2) { - $this->logger->notice('Commit processed', ['duration' => round(microtime(true) - $timestamp, 3), 'time' => date(DateTimeFormat::ATOM, $data->time_us / 1000000), 'did' => $data->did, 'operation' => $data->commit->operation, 'collection' => $data->commit->collection]); + $this->logger->notice('Commit processed', ['duration' => round(microtime(true) - $timestamp, 3), 'drift' => $drift, 'capped' => $this->capped, 'time' => date(DateTimeFormat::ATOM, $data->time_us / 1000000), 'did' => $data->did, 'operation' => $data->commit->operation, 'collection' => $data->commit->collection]); } }