Update InstanceService, fix banner blurhash memory bug

This commit is contained in:
Daniel Supernault 2023-05-13 00:16:50 -06:00
parent 3aad75abcf
commit 026842dd93
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -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';