mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 23:55:35 +08:00
update to 2.4.3 version (build 403)
add config: swoole.max_wait_time (default 5) add constant MAIN_WORKER add getExpireTS() for LightCache fix savePersistence() bug add zm_go() to prevent errors
This commit is contained in:
26
src/ZM/Event/SwooleEvent/OnBeforeReload.php
Normal file
26
src/ZM/Event/SwooleEvent/OnBeforeReload.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace ZM\Event\SwooleEvent;
|
||||
|
||||
|
||||
use Swoole\Process;
|
||||
use ZM\Annotation\Swoole\SwooleHandler;
|
||||
use ZM\Console\Console;
|
||||
use ZM\Event\SwooleEvent;
|
||||
|
||||
/**
|
||||
* Class OnBeforeReload
|
||||
* @package ZM\Event\SwooleEvent
|
||||
* @SwooleHandler("BeforeReload")
|
||||
*/
|
||||
class OnBeforeReload implements SwooleEvent
|
||||
{
|
||||
public function onCall() {
|
||||
Console::info(Console::setColor("Reloading server...", "gold"));
|
||||
for ($i = 0; $i < ZM_WORKER_NUM; ++$i) {
|
||||
Process::kill(zm_atomic("_#worker_".$i)->get(), SIGUSR1);
|
||||
}
|
||||
usleep(800 * 1000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user