This commit is contained in:
2021-05-17 17:30:25 +08:00
parent 1a28e13b34
commit bf30b66153
2 changed files with 16 additions and 3 deletions
+3
View File
@@ -6,6 +6,7 @@ namespace HttpServer\Events;
use Annotation\Annotation;
use Exception;
use HttpServer\Abstracts\Callback;
use Snowflake\Abstracts\Config;
use Snowflake\Event;
use Snowflake\Exception\ConfigException;
use Snowflake\Runtime;
@@ -34,6 +35,8 @@ class OnWorkerStart extends Callback
putenv('state=start');
putenv('worker=' . $worker_id);
Config::sets(sweep(APP_PATH . 'config'));
$annotation = Snowflake::app()->getAnnotation();
$annotation->setLoader(unserialize(file_get_contents(storage(Runtime::CACHE_NAME))));
if ($worker_id >= $server->setting['worker_num']) {