mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-13 19:55:34 +08:00
add cs fixer and PHPStan and activate it (build 436)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZM\Event\SwooleEvent;
|
||||
|
||||
|
||||
use Swoole\Process;
|
||||
use Swoole\WebSocket\Server;
|
||||
use ZM\Annotation\Swoole\SwooleHandler;
|
||||
@@ -13,17 +13,19 @@ use ZM\Event\SwooleEvent;
|
||||
|
||||
/**
|
||||
* Class OnBeforeReload
|
||||
* @package ZM\Event\SwooleEvent
|
||||
* @SwooleHandler("BeforeReload")
|
||||
*/
|
||||
class OnBeforeReload implements SwooleEvent
|
||||
{
|
||||
public function onCall(Server $server) {
|
||||
Console::info(Console::setColor("Reloading server...", "gold"));
|
||||
public function onCall(Server $server)
|
||||
{
|
||||
Console::info(Console::setColor('Reloading server...', 'gold'));
|
||||
for ($i = 0; $i < ZM_WORKER_NUM; ++$i) {
|
||||
Process::kill(zm_atomic("_#worker_" . $i)->get(), SIGUSR1);
|
||||
Process::kill(zm_atomic('_#worker_' . $i)->get(), SIGUSR1);
|
||||
}
|
||||
$conf = ZMConfig::get('global', 'runtime')['reload_delay_time'] ?? 800;
|
||||
if ($conf !== 0) {
|
||||
usleep($conf * 1000);
|
||||
}
|
||||
$conf = ZMConfig::get("global", "runtime")["reload_delay_time"] ?? 800;
|
||||
if ($conf !== 0) usleep($conf * 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user