eee
This commit is contained in:
@@ -70,20 +70,18 @@ class HotReload extends AbstractProcess
|
|||||||
public function process(Process|null $process): void
|
public function process(Process|null $process): void
|
||||||
{
|
{
|
||||||
$this->pipe = inotify_init();
|
$this->pipe = inotify_init();
|
||||||
|
|
||||||
foreach (config('reload.listen') as $value) {
|
foreach (config('reload.listen') as $value) {
|
||||||
$this->readFile($value);
|
$this->readDirectory($value);
|
||||||
}
|
}
|
||||||
while (!$this->isStop()) {
|
while (!$this->isStop()) {
|
||||||
$read = inotify_read($this->pipe);
|
$read = inotify_read($this->pipe);
|
||||||
var_dump($read);
|
|
||||||
|
|
||||||
if (count($read) > 0) {
|
foreach ($read as $item) {
|
||||||
$this->reload();
|
$this->reWatch($this->watches[$item['wd']]);
|
||||||
|
|
||||||
foreach (config('reload.listen') as $value) {
|
|
||||||
$this->reWatch($value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user