This commit is contained in:
xl
2023-07-10 10:34:41 +08:00
parent b7e347162e
commit 1d4073df70
+19
View File
@@ -66,6 +66,25 @@ class HotReload extends BaseProcess
}
$this->onShutdown($data);
});
pcntl_signal(SIGTERM, function ($data) {
var_dump('收到消息');
foreach ($this->watchFiles as $file) {
@inotify_rm_watch($file, $this->inotify);
}
$this->onShutdown($data);
});
pcntl_signal(SIGINT, function ($data) {
var_dump('收到消息');
foreach ($this->watchFiles as $file) {
@inotify_rm_watch($file, $this->inotify);
}
$this->onShutdown($data);
});
}
return $this;
}