Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| efbd390d77 | |||
| 8f3d040cf2 | |||
| 59391c5489 | |||
| 801d4a3129 | |||
| c02f182601 | |||
| 994d0694e8 | |||
| c170ed745e | |||
| 7c1f950ea3 | |||
| de67663c64 | |||
| d46f09bd18 | |||
| 36fedb789e |
@@ -36,7 +36,7 @@ abstract class Server
|
||||
if (Kiri::getPlatform()->isMac()) {
|
||||
return;
|
||||
}
|
||||
$name = Config::get('id', 'system-service');
|
||||
$name = '[' . Config::get('id', 'system-service') . ']';
|
||||
if (!empty($prefix)) {
|
||||
$name .= '.' . $prefix;
|
||||
}
|
||||
|
||||
@@ -75,9 +75,8 @@ class OnServerWorker extends \Server\Abstracts\Server
|
||||
*/
|
||||
public function onWorkerStop(Server $server, int $workerId)
|
||||
{
|
||||
$this->eventDispatch->dispatch(new OnWorkerStop($server, $workerId));
|
||||
|
||||
Timer::clearAll();
|
||||
Timer::clearAll();
|
||||
$this->eventDispatch->dispatch(new OnWorkerStop($server, $workerId));
|
||||
}
|
||||
|
||||
|
||||
@@ -88,10 +87,10 @@ class OnServerWorker extends \Server\Abstracts\Server
|
||||
*/
|
||||
public function onWorkerExit(Server $server, int $workerId)
|
||||
{
|
||||
$this->eventDispatch->dispatch(new OnWorkerExit($server, $workerId));
|
||||
|
||||
ServerManager::setEnv('state', 'exit');
|
||||
}
|
||||
|
||||
$this->eventDispatch->dispatch(new OnWorkerExit($server, $workerId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -112,7 +111,7 @@ class OnServerWorker extends \Server\Abstracts\Server
|
||||
|
||||
$this->logger->error($message);
|
||||
|
||||
$this->system_mail($message);
|
||||
// $this->system_mail($message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ class Server extends HttpService
|
||||
{
|
||||
|
||||
private array $process = [
|
||||
LoggerProcess::class
|
||||
];
|
||||
|
||||
|
||||
|
||||
+6
-4
@@ -6,7 +6,6 @@ namespace Server;
|
||||
|
||||
use Annotation\Inject;
|
||||
use Exception;
|
||||
use Http\Handler\Router;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Events\EventProvider;
|
||||
use Kiri\Exception\ConfigException;
|
||||
@@ -49,8 +48,8 @@ class ServerCommand extends Command
|
||||
{
|
||||
$this->setName('sw:server')
|
||||
->setDescription('server start|stop|reload|restart')
|
||||
->addArgument('action', InputArgument::REQUIRED)
|
||||
->addOption('daemon', 'd', InputOption::VALUE_OPTIONAL, 'is run daemonize', -1);
|
||||
->addArgument('action', InputArgument::OPTIONAL, 'run action', 'start')
|
||||
->addOption('daemon', 'd', InputOption::VALUE_OPTIONAL, 'is run daemonize');
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +63,10 @@ class ServerCommand extends Command
|
||||
{
|
||||
try {
|
||||
$manager = Kiri::app()->getServer();
|
||||
$manager->setDaemon((int)is_null($input->getOption('daemon')));
|
||||
$manager->setDaemon((int)!is_null($input->getOption('daemon')));
|
||||
if (is_null($input->getArgument('action'))) {
|
||||
$input->setArgument('action', 'restart');
|
||||
}
|
||||
if (!in_array($input->getArgument('action'), self::ACTIONS)) {
|
||||
throw new Exception('I don\'t know what I want to do.');
|
||||
}
|
||||
|
||||
+1
-1
@@ -163,7 +163,7 @@ class ServerManager
|
||||
$customProcess = Kiri::getDi()->get($customProcess);
|
||||
}
|
||||
$process = new Process(function (Process $soloProcess) use ($customProcess) {
|
||||
$system = sprintf('[%s]process[%d]', Config::get('id', 'system-service'), $soloProcess->pid);
|
||||
$system = sprintf('[%s].process[%d]', Config::get('id', 'system-service'), $soloProcess->pid);
|
||||
if (Kiri::getPlatform()->isLinux()) {
|
||||
$soloProcess->name($system . '.' . $customProcess->getName() . ' start.');
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "game-worker/http-server",
|
||||
"name": "game-worker/kiri-http-server",
|
||||
"description": "http-server",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
|
||||
Reference in New Issue
Block a user