This commit is contained in:
as2252258@163.com
2021-03-01 00:55:31 +08:00
parent d56bd0527b
commit 55109fa64d
2 changed files with 36 additions and 32 deletions
-32
View File
@@ -22,13 +22,6 @@ use Swoole\Server;
class OnWorkerStart extends Callback
{
/** @var int|string 重启信号 */
private int $signal = SIGUSR1 | SIGUSR2;
/** @var bool 是否打印 */
private bool $isPrint = false;
/**
* @param Server $server
* @param int $worker_id
@@ -51,7 +44,6 @@ class OnWorkerStart extends Callback
$this->onWorker($server, $worker_id);
}
Coroutine\go([$this, 'onSignal'], $server, $worker_id);
}
@@ -92,30 +84,6 @@ class OnWorkerStart extends Callback
}
/**
* @param $server
* @param $worker_id
*/
public function onSignal($server, $worker_id)
{
// $env = ucfirst(Snowflake::getEnvironmental());
//
// $receive = Coroutine::waitSignal($this->signal, 30);
// while ($receive === true) {
// if ($this->isPrint === false) {
// $this->warning(sprintf('Receive %s#%d stop event.', $env, $worker_id));
// $this->isPrint = true;
// }
// if (!Snowflake::app()->isRun()) {
// break;
// }
// sleep(1);
// }
// return $server->stop($worker_id);
}
/**
* @param $socket
* @param $worker_id