改名
This commit is contained in:
@@ -34,7 +34,7 @@ class DatabasesProviders extends Providers
|
|||||||
$event->on(Event::SERVER_TASK_START, [$this, 'createPool']);
|
$event->on(Event::SERVER_TASK_START, [$this, 'createPool']);
|
||||||
|
|
||||||
$event = Snowflake::app()->getEvent();
|
$event = Snowflake::app()->getEvent();
|
||||||
$event->on(Event::SERVER_MANAGER_START, function () {
|
$event->on(Event::SERVER_BEFORE_START, function () {
|
||||||
$attributes = Snowflake::app()->getAttributes();
|
$attributes = Snowflake::app()->getAttributes();
|
||||||
$attributes->readControllers(MODEL_PATH, 'App\Models', 'models');
|
$attributes->readControllers(MODEL_PATH, 'App\Models', 'models');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -138,6 +138,8 @@ class Server extends Application
|
|||||||
$configs = Config::get('servers', true);
|
$configs = Config::get('servers', true);
|
||||||
Snowflake::clearWorkerId();
|
Snowflake::clearWorkerId();
|
||||||
$baseServer = $this->initCore($configs);
|
$baseServer = $this->initCore($configs);
|
||||||
|
|
||||||
|
fire(Event::SERVER_BEFORE_START);
|
||||||
if (!$baseServer) {
|
if (!$baseServer) {
|
||||||
return 'ok';
|
return 'ok';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class Event extends BaseObject
|
|||||||
const SERVER_MANAGER_STOP = 'SERVER:EVENT:MANAGER:START';
|
const SERVER_MANAGER_STOP = 'SERVER:EVENT:MANAGER:START';
|
||||||
const SERVER_WORKER_STOP = 'SERVER:EVENT:WORKER:STOP';
|
const SERVER_WORKER_STOP = 'SERVER:EVENT:WORKER:STOP';
|
||||||
const SERVER_WORKER_START = 'SERVER:EVENT:WORKER:START';
|
const SERVER_WORKER_START = 'SERVER:EVENT:WORKER:START';
|
||||||
|
const SERVER_BEFORE_START = 'SERVER:EVENT:BEFORE:START';
|
||||||
const SERVER_TASK_START = 'SERVER:EVENT:TASK:START';
|
const SERVER_TASK_START = 'SERVER:EVENT:TASK:START';
|
||||||
const SERVER_WORKER_EXIT = 'SERVER:EVENT:WORKER:EXIT';
|
const SERVER_WORKER_EXIT = 'SERVER:EVENT:WORKER:EXIT';
|
||||||
const SERVER_WORKER_ERROR = 'SERVER:EVENT:WORKER:ERROR';
|
const SERVER_WORKER_ERROR = 'SERVER:EVENT:WORKER:ERROR';
|
||||||
|
|||||||
Reference in New Issue
Block a user