|
@@ -5,6 +5,7 @@ namespace App\Console\Commands;
|
|
|
use App\Models\MpTaskCenter;
|
|
use App\Models\MpTaskCenter;
|
|
|
use App\Services\TaskCenterService;
|
|
use App\Services\TaskCenterService;
|
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Console\Command;
|
|
|
|
|
+use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
class SyncTaskCenterCommand extends Command
|
|
class SyncTaskCenterCommand extends Command
|
|
|
{
|
|
{
|
|
@@ -30,6 +31,16 @@ class SyncTaskCenterCommand extends Command
|
|
|
*/
|
|
*/
|
|
|
public function handle(TaskCenterService $taskCenterService)
|
|
public function handle(TaskCenterService $taskCenterService)
|
|
|
{
|
|
{
|
|
|
|
|
+ // 将剧本资产生成任务表的超时任务设置为失败
|
|
|
|
|
+ DB::table('mp_script_generate_tasks')
|
|
|
|
|
+ ->where('status', 'processing')
|
|
|
|
|
+ ->where('started_at', '<', date('Y-m-d H:i:s', strtotime('-1 hour')))
|
|
|
|
|
+ ->update([
|
|
|
|
|
+ 'status' => 'failed',
|
|
|
|
|
+ 'error_message' => '任务超时',
|
|
|
|
|
+ 'updated_at' => date('Y-m-d H:i:s')
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
dLog('command')->info('开始同步任务中心状态...');
|
|
dLog('command')->info('开始同步任务中心状态...');
|
|
|
|
|
|
|
|
try {
|
|
try {
|