Update Queue.php

This commit is contained in:
Anyon 2019-11-19 10:01:33 +08:00
parent 68d0c9cf59
commit 0d85f1f85b

View File

@ -93,7 +93,8 @@ class Queue extends Controller
public function start() public function start()
{ {
try { try {
$this->success(nl2br($this->app->console->call('xtask:start')->fetch())); $message = nl2br($this->app->console->call('xtask:start')->fetch());
stripos($message, '成功') !== false ? $this->success($message) : $this->error($message);
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (\Exception $e) { } catch (\Exception $e) {
@ -108,7 +109,8 @@ class Queue extends Controller
public function stop() public function stop()
{ {
try { try {
$this->success(nl2br($this->app->console->call('xtask:stop')->fetch())); $message = nl2br($this->app->console->call('xtask:stop')->fetch());
stripos($message, '成功') !== false ? $this->success($message) : $this->error($message);
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (\Exception $e) { } catch (\Exception $e) {