modify
This commit is contained in:
@@ -36,7 +36,6 @@ class OnWorkerStart extends Callback
|
|||||||
|
|
||||||
$annotation = Snowflake::app()->getAnnotation();
|
$annotation = Snowflake::app()->getAnnotation();
|
||||||
$annotation->setLoader(unserialize($content));
|
$annotation->setLoader(unserialize($content));
|
||||||
|
|
||||||
if ($worker_id < $server->setting['worker_num']) {
|
if ($worker_id < $server->setting['worker_num']) {
|
||||||
$this->onWorker($server, $annotation);
|
$this->onWorker($server, $annotation);
|
||||||
} else {
|
} else {
|
||||||
@@ -66,7 +65,9 @@ class OnWorkerStart extends Callback
|
|||||||
{
|
{
|
||||||
putenv('environmental=' . Snowflake::TASK);
|
putenv('environmental=' . Snowflake::TASK);
|
||||||
|
|
||||||
$annotation->runtime(directory('app'),CONTROLLER_PATH);
|
$annotation->runtime(MODEL_PATH);
|
||||||
|
$annotation->runtime(CRONTAB_PATH);
|
||||||
|
$annotation->runtime(CLIENT_PATH);
|
||||||
|
|
||||||
name($server->worker_pid, 'Task#' . $server->worker_id);
|
name($server->worker_pid, 'Task#' . $server->worker_id);
|
||||||
|
|
||||||
@@ -86,7 +87,12 @@ class OnWorkerStart extends Callback
|
|||||||
try {
|
try {
|
||||||
name($server->worker_pid, 'Worker#' . $server->worker_id);
|
name($server->worker_pid, 'Worker#' . $server->worker_id);
|
||||||
|
|
||||||
$annotation->runtime(directory('app'));
|
$annotation->runtime(CONTROLLER_PATH);
|
||||||
|
$annotation->runtime(SOCKET_PATH);
|
||||||
|
$annotation->runtime(MODEL_PATH);
|
||||||
|
$annotation->runtime(CRONTAB_PATH);
|
||||||
|
$annotation->runtime(CLIENT_PATH);
|
||||||
|
$annotation->runtime(TASK_PATH);
|
||||||
|
|
||||||
Snowflake::setWorkerId($server->worker_pid);
|
Snowflake::setWorkerId($server->worker_pid);
|
||||||
putenv('environmental=' . Snowflake::WORKER);
|
putenv('environmental=' . Snowflake::WORKER);
|
||||||
|
|||||||
Reference in New Issue
Block a user