This commit is contained in:
2021-11-18 16:40:57 +08:00
parent e872e04da1
commit a7082b76fd
+7 -3
View File
@@ -63,10 +63,14 @@ class ServerCommand extends Command
if (!in_array($input->getArgument('action'), self::ACTIONS)) {
throw new Exception('I don\'t know what I want to do.');
}
if ($manager->isRunner() && $input->getArgument('action') == 'start') {
throw new Exception('Service is running. Please use restart.');
$reusePort = Config::get('server.settings')[Constant::OPTION_ENABLE_REUSE_PORT] ?? false;
if (!$reusePort) {
if ($manager->isRunner() && $input->getArgument('action') == 'start') {
throw new Exception('Service is running. Please use restart.');
}
$manager->shutdown();
}
$manager->shutdown();
if ($input->getArgument('action') == 'stop') {
throw new Exception('shutdown success');
}