modify
This commit is contained in:
@@ -41,7 +41,7 @@ class OnWorkerStart extends Callback
|
|||||||
|
|
||||||
/** @var ServerInotify $inotify */
|
/** @var ServerInotify $inotify */
|
||||||
$inotify = Snowflake::app()->get(ServerInotify::class);
|
$inotify = Snowflake::app()->get(ServerInotify::class);
|
||||||
$inotify->getLoader($worker_id);
|
$inotify->write(sprintf('%03d', $worker_id));
|
||||||
|
|
||||||
if ($worker_id >= $server->setting['worker_num']) {
|
if ($worker_id >= $server->setting['worker_num']) {
|
||||||
$this->onTask($server, $worker_id);
|
$this->onTask($server, $worker_id);
|
||||||
|
|||||||
@@ -67,6 +67,15 @@ class ServerInotify extends Process
|
|||||||
set_error_handler([$this, 'onErrorHandler']);
|
set_error_handler([$this, 'onErrorHandler']);
|
||||||
$this->dirs = Config::get('inotify', [APP_PATH]);
|
$this->dirs = Config::get('inotify', [APP_PATH]);
|
||||||
|
|
||||||
|
Coroutine\go(function () use ($process) {
|
||||||
|
$workerId = $process->read(3);
|
||||||
|
|
||||||
|
$annotation = Snowflake::app()->getAnnotation();
|
||||||
|
|
||||||
|
$server = Snowflake::app()->getSwoole();
|
||||||
|
$server->sendMessage($annotation->getLoader(),(int) $workerId);
|
||||||
|
});
|
||||||
|
|
||||||
$this->loadAnnotation();
|
$this->loadAnnotation();
|
||||||
|
|
||||||
if (extension_loaded('inotify')) {
|
if (extension_loaded('inotify')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user