作者 赵彬吉

test

@@ -41,9 +41,9 @@ class SyncSubmitTask extends Command @@ -41,9 +41,9 @@ class SyncSubmitTask extends Command
41 $time = time(); 41 $time = time();
42 42
43 43
44 - DB::enableQueryLog(); //启用查询日志  
45 - //清除之前的查询日志  
46 - DB::flushQueryLog(); 44 +// DB::enableQueryLog(); //启用查询日志
  45 +// //清除之前的查询日志
  46 +// DB::flushQueryLog();
47 47
48 $task_info = SyncSubmitTaskModel::find($task_id); 48 $task_info = SyncSubmitTaskModel::find($task_id);
49 if (empty($task_info) || $task_info->status !=3) { 49 if (empty($task_info) || $task_info->status !=3) {
@@ -56,7 +56,9 @@ class SyncSubmitTask extends Command @@ -56,7 +56,9 @@ class SyncSubmitTask extends Command
56 throw new \Exception('项目不存在'); 56 throw new \Exception('项目不存在');
57 } 57 }
58 $task_info->project_id = $project->id; 58 $task_info->project_id = $project->id;
  59 + $time2 = time();
59 SyncSubmitTaskService::handler($task_info); 60 SyncSubmitTaskService::handler($task_info);
  61 + $this->output('任务用时:' . time() - $time2);
60 $task_info->status = 1; 62 $task_info->status = 1;
61 $task_info->save(); 63 $task_info->save();
62 64
@@ -85,10 +87,11 @@ class SyncSubmitTask extends Command @@ -85,10 +87,11 @@ class SyncSubmitTask extends Command
85 $use_time = time() - $time; 87 $use_time = time() - $time;
86 if($use_time > 1){ 88 if($use_time > 1){
87 //数据库查询 89 //数据库查询
88 - $this->output('任务用时:' .$use_time . ' | ' . json_encode(DB::getQueryLog(),JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); 90 + $this->output('任务用时:' .$use_time);
  91 +// $this->output('任务用时:' .$use_time . ' | ' . json_encode(DB::getQueryLog(),JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
89 } 92 }
90 //清除之前的查询日志 93 //清除之前的查询日志
91 - DB::flushQueryLog(); 94 +// DB::flushQueryLog();
92 } 95 }
93 } 96 }
94 97