From 48e2580c8fc47fe61dae27665d4cd894b9010d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 11 Sep 2020 14:53:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Queue/Queue.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Queue/Queue.php b/Queue/Queue.php index efab2ffc..1398e7f4 100644 --- a/Queue/Queue.php +++ b/Queue/Queue.php @@ -59,14 +59,13 @@ class Queue extends \Snowflake\Process\Process Timer::tick(50, function () { $redis = Snowflake::app()->getRedis(); try { - $data = $redis->zRevRange(Waiting::QUEUE_WAITING, 0, 20); - if (empty($data)) { + $params = $redis->zRevRange(Waiting::QUEUE_WAITING, 0, 20); + if (empty($params)) { return; - } else { - Coroutine::create(function ($params) { - $this->scheduler($params); - }, $data); } + Coroutine::create(function () use ($params) { + $this->scheduler($params); + }); } catch (\Throwable $exception) { $this->application->error($exception->getMessage()); } finally {