From adb070f178dfed06639d6dd071034a8b51b057f6 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 21 May 2023 07:34:27 -0600 Subject: [PATCH 1/2] Update scheduler, fix S3 media garbage collection not being executed when cloud storage is enabled via dashboard without .env/config being enabled --- app/Console/Commands/MediaS3GarbageCollector.php | 2 +- app/Console/Kernel.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/MediaS3GarbageCollector.php b/app/Console/Commands/MediaS3GarbageCollector.php index 7cbadc5f3..b6cda43c3 100644 --- a/app/Console/Commands/MediaS3GarbageCollector.php +++ b/app/Console/Commands/MediaS3GarbageCollector.php @@ -45,7 +45,7 @@ class MediaS3GarbageCollector extends Command */ public function handle() { - $enabled = config('pixelfed.cloud_storage'); + $enabled = in_array(config_cache('pixelfed.cloud_storage'), ['1', true, 'true']); if(!$enabled) { $this->error('Cloud storage not enabled. Exiting...'); return; diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index f0a955f8d..11f6d17eb 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -33,7 +33,7 @@ class Kernel extends ConsoleKernel $schedule->command('gc:passwordreset')->dailyAt('09:41'); $schedule->command('gc:sessions')->twiceDaily(13, 23); - if(config('pixelfed.cloud_storage') && config('media.delete_local_after_cloud')) { + if(in_array(config_cache('pixelfed.cloud_storage'), ['1', true, 'true']) && config('media.delete_local_after_cloud')) { $schedule->command('media:s3gc')->hourlyAt(15); } } From a1ab88a8ca3532ce10d0f03832fe77fac5efa77d Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 21 May 2023 07:36:02 -0600 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90a6cf380..b35a7e811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ - Update ApiV1Controller, filter muted/blocked accounts from tag timeline ([f42c1140](https://github.com/pixelfed/pixelfed/commit/f42c1140)) - Update admin moderation logic, only re-add top level posts ([c6ffda96](https://github.com/pixelfed/pixelfed/commit/c6ffda96)) - Update admin dashboard, add mass account deletes ([b8426cce](https://github.com/pixelfed/pixelfed/commit/b8426cce)) +- Update scheduler, fix S3 media garbage collection not being executed when cloud storage is enabled via dashboard without .env/config being enabled ([adb070f1](https://github.com/pixelfed/pixelfed/commit/adb070f1)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.6 (2023-05-03)](https://github.com/pixelfed/pixelfed/compare/v0.11.5...v0.11.6)