This commit is contained in:
2020-09-07 11:51:14 +08:00
parent 4f57a5d237
commit 2b037a858b
+9 -3
View File
@@ -177,15 +177,21 @@ class ServerInotify extends Process
$server->reload();
}
/**
* 清理所有inotify监听
*/
public function clearWatch()
{
foreach ($this->watchFiles as $wd) {
@inotify_rm_watch($this->inotify, $wd);
try {
foreach ($this->watchFiles as $wd) {
@inotify_rm_watch($this->inotify, $wd);
}
} catch (Exception $exception) {
$this->debug($exception->getMessage());
} finally {
$this->watchFiles = [];
}
$this->watchFiles = [];
}