This commit is contained in:
2021-04-19 14:25:58 +08:00
parent ab76dc0889
commit 51af761439
5 changed files with 86 additions and 77 deletions
+7 -9
View File
@@ -65,10 +65,12 @@ class OnWorkerStart extends Callback
{
putenv('environmental=' . Snowflake::TASK);
$annotation->runtime(MODEL_PATH);
$annotation->runtime(CRONTAB_PATH);
$annotation->runtime(CLIENT_PATH);
$annotation->runtime(directory('app'), [
CONTROLLER_PATH,
LISTENER_PATH,
SOCKET_PATH,
TASK_PATH,
]);
name($server->worker_pid, 'Task#' . $server->worker_id);
Snowflake::setTaskId($server->worker_pid);
@@ -90,11 +92,7 @@ class OnWorkerStart extends Callback
$time = microtime(true);
$annotation->runtime(CONTROLLER_PATH);
$this->debug('use time.' . microtime(true) - $time);
$annotation->runtime(SOCKET_PATH);
$annotation->runtime(MODEL_PATH);
$annotation->runtime(CRONTAB_PATH);
$annotation->runtime(CLIENT_PATH);
$annotation->runtime(TASK_PATH);
$annotation->runtime(directory('app'), CONTROLLER_PATH);
Snowflake::setWorkerId($server->worker_pid);
putenv('environmental=' . Snowflake::WORKER);