Daniel Supernault 4 лет назад
Родитель
Сommit
21837be99f
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      app/Console/Commands/CatchUnoptimizedMedia.php

+ 2 - 0
app/Console/Commands/CatchUnoptimizedMedia.php

@@ -42,9 +42,11 @@ class CatchUnoptimizedMedia extends Command
     {
     {
         DB::transaction(function() {
         DB::transaction(function() {
             Media::whereNull('processed_at')
             Media::whereNull('processed_at')
+                ->where('skip_optimize', '!=', true)
                 ->whereNull('remote_url')
                 ->whereNull('remote_url')
                 ->whereNotNull('status_id')
                 ->whereNotNull('status_id')
                 ->whereNotNull('media_path')
                 ->whereNotNull('media_path')
+                ->where('created_at', '>', now()->subHours(1))
                 ->whereIn('mime', [
                 ->whereIn('mime', [
                     'image/jpeg',
                     'image/jpeg',
                     'image/png',
                     'image/png',