Update Config, use config_cache

This commit is contained in:
Daniel Supernault 2024-03-10 04:37:22 -06:00
parent 5e4d4eff9d
commit 7785a2dae4
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -32,7 +32,7 @@ class Config
'uploader' => [ 'uploader' => [
'max_photo_size' => (int) config('pixelfed.max_photo_size'), 'max_photo_size' => (int) config('pixelfed.max_photo_size'),
'max_caption_length' => (int) config_cache('pixelfed.max_caption_length'), 'max_caption_length' => (int) config_cache('pixelfed.max_caption_length'),
'max_altext_length' => (int) config('pixelfed.max_altext_length', 150), 'max_altext_length' => (int) config_cache('pixelfed.max_altext_length', 150),
'album_limit' => (int) config_cache('pixelfed.max_album_length'), 'album_limit' => (int) config_cache('pixelfed.max_album_length'),
'image_quality' => (int) config_cache('pixelfed.image_quality'), 'image_quality' => (int) config_cache('pixelfed.image_quality'),
@ -102,6 +102,12 @@ class Config
}); });
} }
public static function refresh()
{
Cache::forget(self::CACHE_KEY);
return self::get();
}
public static function json() public static function json()
{ {
return json_encode(self::get(), JSON_FORCE_OBJECT); return json_encode(self::get(), JSON_FORCE_OBJECT);