From 8b57da2ba5fd78d94ee31005709389a965d47ef3 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 26 Mar 2021 01:28:10 +0800 Subject: [PATCH] modify --- System/Crontab/Consumer.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/System/Crontab/Consumer.php b/System/Crontab/Consumer.php index 4bfc8fff..166935b4 100644 --- a/System/Crontab/Consumer.php +++ b/System/Crontab/Consumer.php @@ -32,17 +32,14 @@ class Consumer extends Process while (true) { [$value, $startTime] = swoole_unserialize($process->read()); - $crontab = $redis->get($value); + $crontab = swoole_unserialize($redis->get($value)); $redis->del($value); var_dump($crontab); - if (empty($crontab) || !($crontab = swoole_unserialize($crontab))) { + if (!is_object($crontab)) { continue; } - - Coroutine::create(function (Crontab $value, int $startTime) { - $this->dispatch($value); - }, $crontab, $startTime); + $this->dispatch($crontab); } }