This commit is contained in:
as2252258@163.com
2021-05-04 01:11:41 +08:00
parent 712e5bc3eb
commit e4cf347a66
+4 -16
View File
@@ -33,7 +33,10 @@ class OnWorkerStart extends Callback
putenv('state=start');
putenv('worker=' . $worker_id);
$annotation = $this->settings();
$annotation = Snowflake::app()->getAnnotation();
// $annotation->read(directory('app'),'App');
// $annotation->runtime(directory('app'));
if ($worker_id < $server->setting['worker_num']) {
$this->onWorker($server, $annotation);
} else {
@@ -42,21 +45,6 @@ class OnWorkerStart extends Callback
}
/**
* @return \Annotation\Annotation
* @throws \Exception
*/
private function settings(): Annotation
{
$content = System::readFile(storage('runtime.php'));
$annotation = Snowflake::app()->getAnnotation();
$annotation->setLoader(unserialize($content));
return $annotation;
}
/**
* @param Server $server
* @param int $worker_id