This commit is contained in:
2020-09-07 12:07:07 +08:00
parent 9eeca895bf
commit 04bd95a5e4
+1 -1
View File
@@ -40,6 +40,7 @@ class ServerInotify extends Process
public function onHandler(\Swoole\Process $process) public function onHandler(\Swoole\Process $process)
{ {
Snowflake::setProcessId($process->pid); Snowflake::setProcessId($process->pid);
set_error_handler([$this, 'onErrorHandler']);
if (extension_loaded('inotify')) { if (extension_loaded('inotify')) {
$this->inotify = inotify_init(); $this->inotify = inotify_init();
$this->events = IN_MODIFY | IN_DELETE | IN_CREATE | IN_MOVE; $this->events = IN_MODIFY | IN_DELETE | IN_CREATE | IN_MOVE;
@@ -184,7 +185,6 @@ class ServerInotify extends Process
*/ */
public function clearWatch() public function clearWatch()
{ {
set_error_handler([$this, 'onErrorHandler']);
foreach ($this->watchFiles as $wd) { foreach ($this->watchFiles as $wd) {
try { try {
inotify_rm_watch($this->inotify, $wd); inotify_rm_watch($this->inotify, $wd);