1
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Kiri\FileListen;
|
|||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Swoole\Event;
|
use Swoole\Event;
|
||||||
|
use Swoole\Timer;
|
||||||
|
|
||||||
class Inotify
|
class Inotify
|
||||||
{
|
{
|
||||||
@@ -74,7 +75,8 @@ class Inotify
|
|||||||
}
|
}
|
||||||
//非重启类型
|
//非重启类型
|
||||||
if (str_ends_with($ev['name'], '.php')) {
|
if (str_ends_with($ev['name'], '.php')) {
|
||||||
$this->reload();
|
Timer::after(3000, fn()=>$this->reload());
|
||||||
|
$this->isReloading = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,12 +86,6 @@ class Inotify
|
|||||||
*/
|
*/
|
||||||
public function reload()
|
public function reload()
|
||||||
{
|
{
|
||||||
if ($this->isReloading) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->isReloading = true;
|
|
||||||
|
|
||||||
$this->process->trigger_reload();
|
$this->process->trigger_reload();
|
||||||
$this->clearWatch();
|
$this->clearWatch();
|
||||||
foreach ($this->dirs as $root) {
|
foreach ($this->dirs as $root) {
|
||||||
|
|||||||
Reference in New Issue
Block a user