浏览代码

Update media:optimize command

Daniel Supernault 4 年之前
父节点
当前提交
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() {
             Media::whereNull('processed_at')
+                ->where('skip_optimize', '!=', true)
                 ->whereNull('remote_url')
                 ->whereNotNull('status_id')
                 ->whereNotNull('media_path')
+                ->where('created_at', '>', now()->subHours(1))
                 ->whereIn('mime', [
                     'image/jpeg',
                     'image/png',