This commit is contained in:
2020-09-11 14:53:38 +08:00
parent cb52de44ff
commit 48e2580c8f
+5 -6
View File
@@ -59,14 +59,13 @@ class Queue extends \Snowflake\Process\Process
Timer::tick(50, function () { Timer::tick(50, function () {
$redis = Snowflake::app()->getRedis(); $redis = Snowflake::app()->getRedis();
try { try {
$data = $redis->zRevRange(Waiting::QUEUE_WAITING, 0, 20); $params = $redis->zRevRange(Waiting::QUEUE_WAITING, 0, 20);
if (empty($data)) { if (empty($params)) {
return; return;
} else {
Coroutine::create(function ($params) {
$this->scheduler($params);
}, $data);
} }
Coroutine::create(function () use ($params) {
$this->scheduler($params);
});
} catch (\Throwable $exception) { } catch (\Throwable $exception) {
$this->application->error($exception->getMessage()); $this->application->error($exception->getMessage());
} finally { } finally {