合并分支 'akun' 到 'master'
Akun 查看合并请求 !3209
正在显示
2 个修改的文件
包含
17 行增加
和
2 行删除
| @@ -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; |
-
请 注册 或 登录 后发表评论