111
This commit is contained in:
@@ -57,7 +57,7 @@ class FileChangeCustomProcess extends Command
|
|||||||
public function execute(InputInterface $input, OutputInterface $output): int
|
public function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
// TODO: Implement onHandler() method.
|
// TODO: Implement onHandler() method.
|
||||||
set_error_handler([$this, 'onErrorHandler']);
|
// set_error_handler([$this, 'onErrorHandler']);
|
||||||
|
|
||||||
$this->dirs = Config::get('inotify', [APP_PATH . 'app']);
|
$this->dirs = Config::get('inotify', [APP_PATH . 'app']);
|
||||||
if (!extension_loaded('inotify')) {
|
if (!extension_loaded('inotify')) {
|
||||||
|
|||||||
@@ -45,10 +45,9 @@ class Inotify
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始监听
|
* 开始监听
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function check()
|
public function check()
|
||||||
{
|
{
|
||||||
@@ -68,12 +67,10 @@ class Inotify
|
|||||||
}
|
}
|
||||||
//非重启类型
|
//非重启类型
|
||||||
if (str_ends_with($ev['name'], '.php')) {
|
if (str_ends_with($ev['name'], '.php')) {
|
||||||
if ($this->process->int !== -1) {
|
if ($this->process->isReloading) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->process->int = @swoole_timer_after(2000, [$this, 'reload']);
|
$this->reload();
|
||||||
|
|
||||||
$this->process->isReloading = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user