This commit is contained in:
2021-04-23 12:19:10 +08:00
parent 8004bd4a16
commit 6332e9e251
+2 -1
View File
@@ -61,13 +61,14 @@ 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(200);
Coroutine::sleep($ticker);
}
}