From ff38efd5f128edadb66febd40d79ba2d4ba739bf Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sun, 12 Dec 2021 17:02:55 +0000 Subject: [PATCH] [PLUGIN][ProfileColor] Cache results --- plugins/ProfileColor/ProfileColor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/ProfileColor/ProfileColor.php b/plugins/ProfileColor/ProfileColor.php index b81f9032f1..7ad3296a35 100644 --- a/plugins/ProfileColor/ProfileColor.php +++ b/plugins/ProfileColor/ProfileColor.php @@ -22,6 +22,7 @@ declare(strict_types = 1); namespace Plugin\ProfileColor; +use App\Core\Cache; use App\Core\DB\DB; use App\Core\Event; use App\Core\Modules\Plugin; @@ -84,7 +85,7 @@ class ProfileColor extends Plugin $actor_id = $actor->getId(); try { - $profile_color_tab = DB::findOneBy('profile_color', ['actor_id' => $actor_id]); + $profile_color_tab = Cache::get("profile-color-{$actor_id}", DB::findOneBy('profile_color', ['actor_id' => $actor_id])); } catch (NotFoundException $e) { return Event::next; }