Update scheduler, fix S3 media garbage collection not being executed when cloud storage is enabled via dashboard without .env/config being enabled

This commit is contained in:
Daniel Supernault 2023-05-21 07:34:27 -06:00
parent 0abc5723bc
commit adb070f178
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 2 additions and 2 deletions

View file

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

View file

@ -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);
}
}