Compare commits

...

11 Commits

Author SHA1 Message Date
as2252258 efbd390d77 改名 2021-11-05 15:08:29 +08:00
as2252258 8f3d040cf2 111 2021-11-05 01:03:49 +08:00
as2252258 59391c5489 111 2021-11-05 01:03:31 +08:00
as2252258 801d4a3129 111 2021-11-05 01:02:49 +08:00
as2252258 c02f182601 111 2021-11-05 01:01:12 +08:00
as2252258 994d0694e8 111 2021-11-05 00:12:13 +08:00
as2252258 c170ed745e 111 2021-11-05 00:01:03 +08:00
as2252258 7c1f950ea3 111 2021-11-05 00:00:05 +08:00
as2252258 de67663c64 111 2021-11-04 23:58:05 +08:00
as2252258 d46f09bd18 改名 2021-11-04 18:53:31 +08:00
as2252258 36fedb789e 改名 2021-11-04 18:50:42 +08:00
6 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -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;
}
+6 -7
View File
@@ -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);
}
-1
View File
@@ -24,7 +24,6 @@ class Server extends HttpService
{
private array $process = [
LoggerProcess::class
];
+6 -4
View File
@@ -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
View File
@@ -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
View File
@@ -1,5 +1,5 @@
{
"name": "game-worker/http-server",
"name": "game-worker/kiri-http-server",
"description": "http-server",
"license": "MIT",
"authors": [