From 3d539c8b54012ec48729ba7729630dba74401d69 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sat, 20 Mar 2021 02:48:29 +0800 Subject: [PATCH] modify --- System/Process/CrontabProcess.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/System/Process/CrontabProcess.php b/System/Process/CrontabProcess.php index bfcaa6dc..edcd7fac 100644 --- a/System/Process/CrontabProcess.php +++ b/System/Process/CrontabProcess.php @@ -34,13 +34,16 @@ class CrontabProcess extends Process public function onHandler(\Swoole\Process $process): void { while (true) { - $content = $process->read(); - $_content = json_decode($content, true); - var_dump($content, $_content); - if (is_null($_content)) { - $this->jobDelivery($content); - } else { - $this->otherAction($_content); + try { + $content = $process->read(); + $_content = json_decode($content, true); + if (is_null($_content)) { + $this->jobDelivery($content); + } else { + $this->otherAction($_content); + } + } catch (\Throwable $exception) { + $this->application->error($exception->getMessage()); } } } @@ -77,6 +80,7 @@ class CrontabProcess extends Process { $content = unserialize($content); $this->names[$content->getName()] = $content; + var_dump($content); if (!($content instanceof Crontab)) { return; }