Update CatchUnoptimizedMedia command, make 1hr limit opt-in

pull/5416/head
Daniel Supernault 2 months ago
parent 6f7e37b3f0
commit 99b15b73f6
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

@ -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', [

@ -24,6 +24,10 @@ return [
],
],
'image_optimize' => [
'catch_unoptimized_media_hour_limit' => env('PF_CATCHUNOPTIMIZEDMEDIA', false),
],
'hls' => [
/*
|--------------------------------------------------------------------------

Loading…
Cancel
Save