From 488561c2701da01f4f6c4324bc330336dcb924ef Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 9 Apr 2022 22:33:14 -0600 Subject: [PATCH] Update ConfigCacheService, fail to fallback earlier --- app/Jobs/ImageOptimizePipeline/ImageOptimize.php | 4 ++++ app/Services/ConfigCacheService.php | 3 +++ 2 files changed, 7 insertions(+) diff --git a/app/Jobs/ImageOptimizePipeline/ImageOptimize.php b/app/Jobs/ImageOptimizePipeline/ImageOptimize.php index 6b7fd4885..e7c1b211e 100644 --- a/app/Jobs/ImageOptimizePipeline/ImageOptimize.php +++ b/app/Jobs/ImageOptimizePipeline/ImageOptimize.php @@ -39,6 +39,10 @@ class ImageOptimize implements ShouldQueue */ public function handle() { + if(config('pixelfed.optimize_image') == false) { + return; + } + $media = $this->media; $path = storage_path('app/'.$media->media_path); if (!is_file($path) || $media->skip_optimize) { diff --git a/app/Services/ConfigCacheService.php b/app/Services/ConfigCacheService.php index 65c57882b..91d644ee7 100644 --- a/app/Services/ConfigCacheService.php +++ b/app/Services/ConfigCacheService.php @@ -14,6 +14,9 @@ class ConfigCacheService { $cacheKey = self::CACHE_KEY . $key; $ttl = now()->addHours(12); + if(!config('instance.enable_cc')) { + return config($key); + } return Cache::remember($cacheKey, $ttl, function() use($key) {