Skip to content

Commit adb070f

Browse files
committed
Update scheduler, fix S3 media garbage collection not being executed when cloud storage is enabled via dashboard without .env/config being enabled
1 parent 0abc572 commit adb070f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/Console/Commands/MediaS3GarbageCollector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct()
4545
*/
4646
public function handle()
4747
{
48-
$enabled = config('pixelfed.cloud_storage');
48+
$enabled = in_array(config_cache('pixelfed.cloud_storage'), ['1', true, 'true']);
4949
if(!$enabled) {
5050
$this->error('Cloud storage not enabled. Exiting...');
5151
return;

app/Console/Kernel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function schedule(Schedule $schedule)
3333
$schedule->command('gc:passwordreset')->dailyAt('09:41');
3434
$schedule->command('gc:sessions')->twiceDaily(13, 23);
3535

36-
if(config('pixelfed.cloud_storage') && config('media.delete_local_after_cloud')) {
36+
if(in_array(config_cache('pixelfed.cloud_storage'), ['1', true, 'true']) && config('media.delete_local_after_cloud')) {
3737
$schedule->command('media:s3gc')->hourlyAt(15);
3838
}
3939
}

0 commit comments

Comments
 (0)