作者 刘锟

update

@@ -63,7 +63,7 @@ class KeywordPageAiContent extends Command @@ -63,7 +63,7 @@ class KeywordPageAiContent extends Command
63 while (true) { 63 while (true) {
64 $task = ProjectKeywordAiTask::getPendingTask(); 64 $task = ProjectKeywordAiTask::getPendingTask();
65 if (!$task) { 65 if (!$task) {
66 - sleep(10); 66 + sleep(60);
67 continue; 67 continue;
68 } 68 }
69 $project_id = $task->project_id; 69 $project_id = $task->project_id;
@@ -78,7 +78,17 @@ class KeywordPageAiContent extends Command @@ -78,7 +78,17 @@ class KeywordPageAiContent extends Command
78 78
79 ProjectKeywordAiTask::finish($task->id, $update_rows); 79 ProjectKeywordAiTask::finish($task->id, $update_rows);
80 80
81 - $update_rows && $this->sendNotify($project_id); 81 +// $update_rows && $this->sendNotify($project_id);
  82 +
  83 + if($update_rows){
  84 + //缓存 在发送页面更新的项目数据 id
  85 + $notify_cache_key = "keyword_page_ai_content_notify_{$project_id}";
  86 + if(Redis::setnx($notify_cache_key, 1)){
  87 + Redis::expire($notify_cache_key, 120);
  88 +
  89 + $this->sendNotify($project_id); //通知主站按需更新
  90 + }
  91 + }
82 92
83 } catch (ValidateException $e) { 93 } catch (ValidateException $e) {
84 echo getmypid() . ' ' . date('Y-m-d H:i:s') . 'line: ' . $e->getLine() . ' error: ' . $project_id . '->' . $e->getMessage() . PHP_EOL; 94 echo getmypid() . ' ' . date('Y-m-d H:i:s') . 'line: ' . $e->getLine() . ' error: ' . $project_id . '->' . $e->getMessage() . PHP_EOL;
@@ -52,6 +52,11 @@ class Temp extends Command @@ -52,6 +52,11 @@ class Temp extends Command
52 52
53 } 53 }
54 54
  55 + public function geoProjectMatchOptimist()
  56 + {
  57 +
  58 + }
  59 +
55 /** 60 /**
56 * 4301项目特殊产品数据导入 61 * 4301项目特殊产品数据导入
57 * @return bool 62 * @return bool