From 026842dd93bf9414393b578909432fcc8627cf1a Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 13 May 2023 00:16:50 -0600 Subject: [PATCH] Update InstanceService, fix banner blurhash memory bug --- app/Services/InstanceService.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Services/InstanceService.php b/app/Services/InstanceService.php index 85c5ed69a..5b2b6a12c 100644 --- a/app/Services/InstanceService.php +++ b/app/Services/InstanceService.php @@ -16,6 +16,11 @@ class InstanceService const CACHE_KEY_STATS = 'pf:services:instances:stats'; const CACHE_KEY_BANNER_BLURHASH = 'pf:services:instance:header-blurhash:v1'; + public function __construct() + { + ini_set('memory_limit', config('pixelfed.memory_limit', '1024M')); + } + public static function getByDomain($domain) { return Cache::remember(self::CACHE_KEY_BY_DOMAIN.$domain, 3600, function() use($domain) { @@ -84,8 +89,6 @@ class InstanceService public static function headerBlurhash() { - ini_set('memory_limit', config('pixelfed.memory_limit', '1024M')); - return Cache::rememberForever(self::CACHE_KEY_BANNER_BLURHASH, function() { if(str_ends_with(config_cache('app.banner_image'), 'headers/default.jpg')) { return 'UzJR]l{wHZRjM}R%XRkCH?X9xaWEjZj]kAjt';