mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-20 22:09:15 +08:00
Update Queue.php
This commit is contained in:
parent
761e208d00
commit
49dabf2d1a
@ -110,9 +110,13 @@ class Queue extends Controller
|
|||||||
public function start()
|
public function start()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
// Asynchronous daemons already exist for pid 1680
|
||||||
|
// Asynchronous daemons started successfully for pid 15740
|
||||||
$message = nl2br($this->app->console->call('xadmin:queue', ['start'])->fetch());
|
$message = nl2br($this->app->console->call('xadmin:queue', ['start'])->fetch());
|
||||||
if (preg_match('/process.*?\d+/', $message, $attr)) {
|
if (stripos($message, 'daemons started successfully for pid')) {
|
||||||
$this->success('任务监听主进程启动成功!');
|
$this->success('任务监听主进程启动成功!');
|
||||||
|
} elseif (stripos($message, 'daemons already exist for pid')) {
|
||||||
|
$this->success('任务监听主进程已经存在!');
|
||||||
} else {
|
} else {
|
||||||
$this->error($message);
|
$this->error($message);
|
||||||
}
|
}
|
||||||
@ -131,9 +135,9 @@ class Queue extends Controller
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$message = nl2br($this->app->console->call('xadmin:queue', ['stop'])->fetch());
|
$message = nl2br($this->app->console->call('xadmin:queue', ['stop'])->fetch());
|
||||||
if (stripos($message, 'succeeded')) {
|
if (stripos($message, 'sent end signal to process')) {
|
||||||
$this->success('停止任务监听主进程成功!');
|
$this->success('停止任务监听主进程成功!');
|
||||||
} elseif (stripos($message, 'finish')) {
|
} elseif (stripos($message, 'processes to stop')) {
|
||||||
$this->success('没有找到需要停止的进程!');
|
$this->success('没有找到需要停止的进程!');
|
||||||
} else {
|
} else {
|
||||||
$this->error($message);
|
$this->error($message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user