This commit is contained in:
2021-03-02 15:30:10 +08:00
parent 658229d430
commit 3b5030144b
-21
View File
@@ -22,11 +22,6 @@ use Swoole\Server;
class OnWorkerStart extends Callback
{
/** @var int 重启信号 */
private int $signal = SIGUSR1 | SIGKILL | SIGKILL;
/**
* @param Server $server
* @param int $worker_id
@@ -46,7 +41,6 @@ class OnWorkerStart extends Callback
}
$this->debug(sprintf('%s #%d Pid:%d start.', ucfirst(env('environmental')), $worker_id, $server->worker_pid));
Coroutine\go([$this, 'onSignal'], $server, $worker_id);
}
@@ -85,21 +79,6 @@ class OnWorkerStart extends Callback
}
/**
* @param $server
* @param $worker_id
* @return void
*/
public function onSignal(Server $server, $worker_id): mixed
{
$ret = Coroutine::waitSignal($this->signal, -1);
if ($ret === true) {
$this->ticker();
}
return $server->stop();
}
/**
* @return void
*/