From 8004bd4a169dea101f17b23bf413308260b37d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 23 Apr 2021 12:03:24 +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 --- System/Crontab/Zookeeper.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/System/Crontab/Zookeeper.php b/System/Crontab/Zookeeper.php index 98ba369c..0f0c8b84 100644 --- a/System/Crontab/Zookeeper.php +++ b/System/Crontab/Zookeeper.php @@ -42,7 +42,7 @@ class Zookeeper extends Process /** * @param \Swoole\Process $process - * @throws \Snowflake\Exception\ConfigException + * @throws Exception */ public function before(\Swoole\Process $process): void { @@ -61,25 +61,22 @@ class Zookeeper extends Process */ public function onHandler(\Swoole\Process $process): void { - $ticker = Config::get('crontab.ticker', 50) / 1000; $redis = Snowflake::app()->getRedis(); while (true) { $range = $this->loadCarobTask($redis); foreach ($range as $value) { $this->dispatch($redis, $value); } - Coroutine::sleep($ticker); + Coroutine::sleep(200); } } - /** - * @param $server - * @param Redis|\Redis $redis - * @param int $setting - * @param $value - * @throws Exception - */ + /** + * @param Redis|\Redis $redis + * @param $value + * @throws Exception + */ private function dispatch(Redis|\Redis $redis, $value) { try {