This commit is contained in:
2021-11-05 00:12:13 +08:00
parent 8d98dc83be
commit 7d8c50aed8
+6 -3
View File
@@ -45,9 +45,10 @@ class Inotify
} }
/** /**
* 开始监听 * 开始监听
* @throws Exception
*/ */
public function check() public function check()
{ {
@@ -67,10 +68,12 @@ class Inotify
} }
//非重启类型 //非重启类型
if (str_ends_with($ev['name'], '.php')) { if (str_ends_with($ev['name'], '.php')) {
if ($this->process->isReloading) { if ($this->process->int !== -1) {
return; return;
} }
$this->reload(); $this->process->int = @swoole_timer_after(2000, [$this, 'reload']);
$this->process->isReloading = true;
} }
} }
} }