From 4f99479009aca5d3c51779435b651cbbabcee66a Mon Sep 17 00:00:00 2001 From: jack <958691165@qq.com> Date: Fri, 16 Jan 2026 14:17:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(Qscmf):=20=E6=B7=BB=E5=8A=A0=E5=81=A5?= =?UTF-8?q?=E5=BA=B7=E6=A3=80=E6=9F=A5=E6=8E=A7=E5=88=B6=E5=99=A8=E5=92=8C?= =?UTF-8?q?=E9=98=9F=E5=88=97=E7=9B=91=E6=8E=A7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增HealthCheckController用于检查队列状态,当队列超过60秒未更新时返回500错误。 在Worker类中添加队列心跳更新逻辑,定时更新Redis中的队列时间戳。 --- .../HealthCheckController.class.php | 25 +++++++++++++++++++ .../Lib/Tp3Resque/Resque/Worker.class.php | 4 +++ 2 files changed, 29 insertions(+) create mode 100644 src/Library/Qscmf/Controller/HealthCheckController.class.php diff --git a/src/Library/Qscmf/Controller/HealthCheckController.class.php b/src/Library/Qscmf/Controller/HealthCheckController.class.php new file mode 100644 index 00000000..23691e0d --- /dev/null +++ b/src/Library/Qscmf/Controller/HealthCheckController.class.php @@ -0,0 +1,25 @@ +error('参数错误'); + } + + $tick = S('health_tick_queue_'.$queue); + + if (time() - $tick > 60){ + send_http_status(500); + echo 'ERROR: queue check fail - '.$queue; + return; + } + + echo $tick. ' health check success.'; + } +} \ No newline at end of file diff --git a/src/Library/Qscmf/Lib/Tp3Resque/Resque/Worker.class.php b/src/Library/Qscmf/Lib/Tp3Resque/Resque/Worker.class.php index 7c3f56a1..17a4cb87 100644 --- a/src/Library/Qscmf/Lib/Tp3Resque/Resque/Worker.class.php +++ b/src/Library/Qscmf/Lib/Tp3Resque/Resque/Worker.class.php @@ -170,6 +170,10 @@ public function work($interval = 5) break; } + foreach ($this->queues as $queue) { + S('health_tick_queue_'.$queue, time()); + } + $this->log("round start:" . convert(memory_get_usage(true))); if (!$this->paused From bbc4b0a62d98a1373e2cc0cd718ea192a13c05c0 Mon Sep 17 00:00:00 2001 From: jack <958691165@qq.com> Date: Thu, 12 Feb 2026 10:45:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(ListSearchType):=20=E6=9B=B4=E6=96=B0S?= =?UTF-8?q?electText=E7=BB=84=E4=BB=B6=E8=BF=94=E5=9B=9E=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=B8=BAColumnType?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SelectText组件的tableSearchAntdRender方法现在返回 \AntdAdmin\Component\Table\ColumnType\SelectText类型, 而不是之前的数组形式。移除了原有的Select和Text组件实例化代码, 改为直接创建SelectText列类型并设置选项枚举值。 --- .../ListSearchType/SelectText/SelectText.class.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Library/Qscmf/Builder/ListSearchType/SelectText/SelectText.class.php b/src/Library/Qscmf/Builder/ListSearchType/SelectText/SelectText.class.php index 35f7f6d6..1d3200ff 100644 --- a/src/Library/Qscmf/Builder/ListSearchType/SelectText/SelectText.class.php +++ b/src/Library/Qscmf/Builder/ListSearchType/SelectText/SelectText.class.php @@ -34,12 +34,9 @@ static public function parse(array $keys_rule, array $get_data): array } } - public function tableSearchAntdRender($options, $listBuilder): array + public function tableSearchAntdRender($options, $listBuilder): \AntdAdmin\Component\Table\ColumnType\SelectText { - $key = new Select('key', $options['title']); - $key->setValueEnum($options['options']); - - $word = new Text('word', ''); - return [$key, $word]; + $column = new \AntdAdmin\Component\Table\ColumnType\SelectText('key:word', ''); + return $column->setValueEnum($options['options']); } } \ No newline at end of file