改名
This commit is contained in:
@@ -92,14 +92,16 @@ class ServerInotify extends Process
|
|||||||
if (!isset($this->md5Map[$md5])) {
|
if (!isset($this->md5Map[$md5])) {
|
||||||
if ($isReload) {
|
if ($isReload) {
|
||||||
$this->isReloading = true;
|
$this->isReloading = true;
|
||||||
return Timer::after(2000, [$this, 'reload']);
|
Timer::clearAll();
|
||||||
|
return Timer::after(2000, [$this, 'timerReload']);
|
||||||
}
|
}
|
||||||
$this->md5Map[$md5] = $mTime;
|
$this->md5Map[$md5] = $mTime;
|
||||||
} else {
|
} else {
|
||||||
if ($this->md5Map[$md5] != $mTime) {
|
if ($this->md5Map[$md5] != $mTime) {
|
||||||
if ($isReload) {
|
if ($isReload) {
|
||||||
$this->isReloading = true;
|
$this->isReloading = true;
|
||||||
return Timer::after(2000, [$this, 'reload']);
|
Timer::clearAll();
|
||||||
|
return Timer::after(2000, [$this, 'timerReload']);
|
||||||
}
|
}
|
||||||
$this->md5Map[$md5] = $mTime;
|
$this->md5Map[$md5] = $mTime;
|
||||||
}
|
}
|
||||||
@@ -165,10 +167,23 @@ class ServerInotify extends Process
|
|||||||
$this->isReloading = FALSE;
|
$this->isReloading = FALSE;
|
||||||
$this->isReloadingOut = FALSE;
|
$this->isReloadingOut = FALSE;
|
||||||
$this->md5Map = [];
|
$this->md5Map = [];
|
||||||
if (Snowflake::isMac()) {
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function timerReload()
|
||||||
|
{
|
||||||
|
$this->isReloading = true;
|
||||||
|
$this->trigger_reload();
|
||||||
|
$this->int = -1;
|
||||||
|
$this->isReloading = FALSE;
|
||||||
|
$this->isReloadingOut = FALSE;
|
||||||
|
$this->md5Map = [];
|
||||||
$this->loadByDir(APP_PATH . 'app');
|
$this->loadByDir(APP_PATH . 'app');
|
||||||
$this->loadByDir(APP_PATH . 'routes');
|
$this->loadByDir(APP_PATH . 'routes');
|
||||||
}
|
|
||||||
|
Timer::tick(2000, [$this, 'tick']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user