Skip to content

Commit

Permalink
Update Monitor.php
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor authored Jul 2, 2023
1 parent 9d9df8e commit 4768299
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions process/Monitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,13 @@ public function checkFilesChange($monitorDir): bool
continue;
}
// check mtime
if ($lastMtime < $file->getMTime() && in_array($file->getExtension(), $this->extensions, true)) {
if (in_array($file->getExtension(), $this->extensions, true) && $lastMtime < $file->getMTime()) {
$var = 0;
exec('"'.PHP_BINARY . '" -l ' . $file, $out, $var);
$lastMtime = $file->getMTime();
if ($var) {
$lastMtime = $file->getMTime();
continue;
}
$lastMtime = $file->getMTime();
echo $file . " update and reload\n";
// send SIGUSR1 signal to master process for reload
if (DIRECTORY_SEPARATOR === '/') {
Expand Down

0 comments on commit 4768299

Please sign in to comment.