diff --git a/Inotify.php b/Inotify.php index 6baf2de..6c4c41b 100644 --- a/Inotify.php +++ b/Inotify.php @@ -63,11 +63,12 @@ class Inotify extends BaseProcess public function onSigterm(): static { - $this->isStop = true; + pcntl_signal(SIGTERM, function () { + $this->isStop = true; - $this->clear(); - - return parent::onSigterm(); // TODO: Change the autogenerated stub + $this->clear(); + }); + return $this; }