作者 赵彬吉

test

... ... @@ -41,9 +41,9 @@ class SyncSubmitTask extends Command
$time = time();
DB::enableQueryLog(); //启用查询日志
//清除之前的查询日志
DB::flushQueryLog();
// DB::enableQueryLog(); //启用查询日志
// //清除之前的查询日志
// DB::flushQueryLog();
$task_info = SyncSubmitTaskModel::find($task_id);
if (empty($task_info) || $task_info->status !=3) {
... ... @@ -56,7 +56,9 @@ class SyncSubmitTask extends Command
throw new \Exception('项目不存在');
}
$task_info->project_id = $project->id;
$time2 = time();
SyncSubmitTaskService::handler($task_info);
$this->output('任务用时:' . time() - $time2);
$task_info->status = 1;
$task_info->save();
... ... @@ -85,10 +87,11 @@ class SyncSubmitTask extends Command
$use_time = time() - $time;
if($use_time > 1){
//数据库查询
$this->output('任务用时:' .$use_time . ' | ' . json_encode(DB::getQueryLog(),JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
$this->output('任务用时:' .$use_time);
// $this->output('任务用时:' .$use_time . ' | ' . json_encode(DB::getQueryLog(),JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
}
//清除之前的查询日志
DB::flushQueryLog();
// DB::flushQueryLog();
}
}
... ...