mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
Fixed server:start
failed, when the config of pid_file changed. (#2356)
Co-authored-by: 李铭昕 <715557344@qq.com>
This commit is contained in:
parent
339ecd9e2e
commit
87590fb644
@ -9,6 +9,7 @@
|
||||
## Fixed
|
||||
|
||||
- [#2331](https://github.com/hyperf/hyperf/pull/2331) Fixed exception thrown when the service or config was not found for nacos.
|
||||
- [#2356](https://github.com/hyperf/hyperf/pull/2356) Fixed `server:start` failed, when the config of pid_file changed.
|
||||
|
||||
# v2.0.8 - 2020-08-24
|
||||
|
||||
|
@ -16,6 +16,7 @@ use Hyperf\Di\Annotation\ScanConfig;
|
||||
use Hyperf\Di\ClassLoader;
|
||||
use Hyperf\Utils\Codec\Json;
|
||||
use Hyperf\Utils\Coroutine;
|
||||
use Hyperf\Utils\Filesystem\FileNotFoundException;
|
||||
use Hyperf\Utils\Filesystem\Filesystem;
|
||||
use Hyperf\Watcher\Driver\DriverInterface;
|
||||
use PhpParser\PrettyPrinter\Standard;
|
||||
@ -146,7 +147,10 @@ class Watcher
|
||||
|
||||
public function restart($isStart = true)
|
||||
{
|
||||
$file = BASE_PATH . '/runtime/hyperf.pid';
|
||||
$file = config('server.settings.pid_file');
|
||||
if (empty($file)) {
|
||||
throw new FileNotFoundException('pid_file is not found.');
|
||||
}
|
||||
if (! $isStart && $this->filesystem->exists($file)) {
|
||||
$pid = $this->filesystem->get($file);
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user