mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update ConfigCacheService, fail to fallback earlier
This commit is contained in:
parent
251e455c25
commit
488561c270
2 changed files with 7 additions and 0 deletions
|
@ -39,6 +39,10 @@ class ImageOptimize implements ShouldQueue
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
if(config('pixelfed.optimize_image') == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$media = $this->media;
|
$media = $this->media;
|
||||||
$path = storage_path('app/'.$media->media_path);
|
$path = storage_path('app/'.$media->media_path);
|
||||||
if (!is_file($path) || $media->skip_optimize) {
|
if (!is_file($path) || $media->skip_optimize) {
|
||||||
|
|
|
@ -14,6 +14,9 @@ class ConfigCacheService
|
||||||
{
|
{
|
||||||
$cacheKey = self::CACHE_KEY . $key;
|
$cacheKey = self::CACHE_KEY . $key;
|
||||||
$ttl = now()->addHours(12);
|
$ttl = now()->addHours(12);
|
||||||
|
if(!config('instance.enable_cc')) {
|
||||||
|
return config($key);
|
||||||
|
}
|
||||||
|
|
||||||
return Cache::remember($cacheKey, $ttl, function() use($key) {
|
return Cache::remember($cacheKey, $ttl, function() use($key) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue