lh 3 viikkoa sitten
vanhempi
commit
006eb84fe2

+ 1 - 0
app/Console/Commands/CheckVideoGenerationTasksCommand.php

@@ -70,6 +70,7 @@ class CheckVideoGenerationTasksCommand extends Command
                 ->where('video_task_status', '生成中')
                 ->whereNotNull('video_task_id')
                 ->where('video_task_id', '<>', '')
+                ->where('created_at', '<', date('Y-m-d H:i:s', strtotime('-20 hours')))
                 ->select('id', 'segment_id', 'video_task_id', 'audio_duration')
                 ->get();
 

+ 2 - 2
app/Libs/Helpers.php

@@ -1002,8 +1002,8 @@ function compressVideo($videoUrl, $prefix = 'videos')
             chmod($tempDir, 0775);
         }
 
-        // 生成唯一文件名
-        $uniqueId = uniqid('video_', true);
+        // 生成唯一文件名(不包含点号)
+        $uniqueId = uniqid('video_') . bin2hex(random_bytes(4));
         $videoExt = getVideoExtFromUrl($videoUrl);
         $inputFile = $tempDir . '/' . $uniqueId . '_input' . $videoExt;
         $outputFile = $tempDir . '/' . $uniqueId . '_output.mp4';