This commit is contained in:
2021-03-29 10:40:47 +08:00
parent 38748d1f8c
commit 4d69d4bfaf
+3
View File
@@ -41,13 +41,16 @@ class ZookeeperProcess extends Process
* @throws ReflectionException * @throws ReflectionException
* @throws ComponentException * @throws ComponentException
* @throws NotFindClassException * @throws NotFindClassException
* @throws Exception
*/ */
public function onHandler(\Swoole\Process $process): void public function onHandler(\Swoole\Process $process): void
{ {
$crontab = Snowflake::app()->get('crontab'); $crontab = Snowflake::app()->get('crontab');
$crontab->clearAll(); $crontab->clearAll();
if (Snowflake::getPlatform()->isLinux()) {
$process->name('Crontab zookeeper.'); $process->name('Crontab zookeeper.');
}
Timer::tick(1000, function () { Timer::tick(1000, function () {
$startTime = time(); $startTime = time();