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