diff --git a/app/Console/Commands/CatchUnoptimizedMedia.php b/app/Console/Commands/CatchUnoptimizedMedia.php index 4887cb8e3..a5bb22f98 100644 --- a/app/Console/Commands/CatchUnoptimizedMedia.php +++ b/app/Console/Commands/CatchUnoptimizedMedia.php @@ -40,10 +40,11 @@ class CatchUnoptimizedMedia extends Command */ public function handle() { + $hasLimit = (bool) config('media.image_optimize.catch_unoptimized_media_hour_limit'); Media::whereNull('processed_at') - // This is commented out because Instagram imported posts would not get uploaded to remote storage - // ->where('created_at', '>', now()->subHours(1)) - ->whereNull('remote_url') + ->when($hasLimit, function($q, $hasLimit) { + $q->where('created_at', '>', now()->subHours(1)); + })->whereNull('remote_url') ->whereNotNull('status_id') ->whereNotNull('media_path') ->whereIn('mime', [ diff --git a/config/media.php b/config/media.php index 46c1719db..5e3b32ae6 100644 --- a/config/media.php +++ b/config/media.php @@ -24,6 +24,10 @@ return [ ], ], + 'image_optimize' => [ + 'catch_unoptimized_media_hour_limit' => env('PF_CATCHUNOPTIMIZEDMEDIA', false), + ], + 'hls' => [ /* |--------------------------------------------------------------------------