From 263d3172118b421a3113681bf280f1c04ceba9b3 Mon Sep 17 00:00:00 2001 From: Anyon Date: Sat, 23 Nov 2019 18:45:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9F=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Queue.php | 1 + app/admin/view/queue/index_search.html | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/admin/controller/Queue.php b/app/admin/controller/Queue.php index 4ae6febd9..9fe078c66 100644 --- a/app/admin/controller/Queue.php +++ b/app/admin/controller/Queue.php @@ -46,6 +46,7 @@ class Queue extends Controller try { $this->command = ProcessService::instance()->think('xtask:start'); $this->message = $this->app->console->call('xtask:state')->fetch(); + $this->listen = preg_match('/主进程\d+/', $this->message, $attr); } catch (\Exception $exception) { $this->message = $exception->getMessage(); } diff --git a/app/admin/view/queue/index_search.html b/app/admin/view/queue/index_search.html index 244c6e598..e697cfc43 100644 --- a/app/admin/view/queue/index_search.html +++ b/app/admin/view/queue/index_search.html @@ -7,7 +7,11 @@ popen shell_exe

当前消息队列守护进程运行状态

- {$message|raw|default='--'} + {if $listen} + {$message|raw|default='--'} + {else} + {$message|raw|default='--'} + {/if}

配置定时任务来检查并启动进程(建议每分钟执行)

{$command|default='--'}