Update CatchUnoptimizedMedia command, make 1hr limit opt-in

This commit is contained in:
Daniel Supernault 2025-01-03 21:38:07 -07:00
parent 6f7e37b3f0
commit 99b15b73f6
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1
2 changed files with 8 additions and 3 deletions

View file

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

View file

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