Update CatchUnoptimizedMedia command, make 1hr limit opt-in

pull/5416/head
Daniel Supernault 2025-01-03 21:38:07 -07:00
rodzic 6f7e37b3f0
commit 99b15b73f6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 23740873EE6F76A1
2 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -40,10 +40,11 @@ class CatchUnoptimizedMedia extends Command
*/ */
public function handle() public function handle()
{ {
$hasLimit = (bool) config('media.image_optimize.catch_unoptimized_media_hour_limit');
Media::whereNull('processed_at') Media::whereNull('processed_at')
// This is commented out because Instagram imported posts would not get uploaded to remote storage ->when($hasLimit, function($q, $hasLimit) {
// ->where('created_at', '>', now()->subHours(1)) $q->where('created_at', '>', now()->subHours(1));
->whereNull('remote_url') })->whereNull('remote_url')
->whereNotNull('status_id') ->whereNotNull('status_id')
->whereNotNull('media_path') ->whereNotNull('media_path')
->whereIn('mime', [ ->whereIn('mime', [

Wyświetl plik

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