作者 lyh

变更数据

@@ -88,7 +88,6 @@ class GeoQuestionRes extends Command @@ -88,7 +88,6 @@ class GeoQuestionRes extends Command
88 $geoLogModel = new GeoQuestionLog(); 88 $geoLogModel = new GeoQuestionLog();
89 foreach ($taskInfo['question'] as $question) { 89 foreach ($taskInfo['question'] as $question) {
90 Redis::expire($lock_key, 1200); // 一个问题执行时间可能会达到15-18分钟 90 Redis::expire($lock_key, 1200); // 一个问题执行时间可能会达到15-18分钟
91 -  
92 $en_question = Translate::tran($question, 'zh') ?? ''; 91 $en_question = Translate::tran($question, 'zh') ?? '';
93 $this->output('项目ID:' . $taskInfo['project_id'] . ', 问题 开始:' . $question); 92 $this->output('项目ID:' . $taskInfo['project_id'] . ', 问题 开始:' . $question);
94 foreach ($platformsArr as $platform) { 93 foreach ($platformsArr as $platform) {
@@ -352,9 +351,9 @@ class GeoQuestionRes extends Command @@ -352,9 +351,9 @@ class GeoQuestionRes extends Command
352 $lock_ttl = 60; // 锁时间大于当前 锁功能执行时间 351 $lock_ttl = 60; // 锁时间大于当前 锁功能执行时间
353 // 尝试获取锁,非阻塞方式 352 // 尝试获取锁,非阻塞方式
354 $lock = Redis::set($lock_key, 1, 'EX', $lock_ttl, 'NX'); 353 $lock = Redis::set($lock_key, 1, 'EX', $lock_ttl, 'NX');
355 - if (empty($lock)) 354 + if (empty($lock)){
356 return $task_id; 355 return $task_id;
357 - 356 + }
358 $project_ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)->where('next_time', '<=', date('Y-m-d'))->pluck('project_id')->unique()->values()->toArray(); 357 $project_ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)->where('next_time', '<=', date('Y-m-d'))->pluck('project_id')->unique()->values()->toArray();
359 if(FALSE == empty($project_ids)){ 358 if(FALSE == empty($project_ids)){
360 $ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN) 359 $ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)