1
This commit is contained in:
parent
59d0a88a60
commit
19fd619f28
12
f8/app.cc
12
f8/app.cc
@ -14,11 +14,17 @@
|
||||
#include <f8/msgqueue.h>
|
||||
#include <f8/timer.h>
|
||||
#include <f8/protoutils.h>
|
||||
#include <f8/tglog.h>
|
||||
#include <f8/httpclientpool.h>
|
||||
|
||||
static const int MAX_ZONE_ID = 100;
|
||||
static const int MAX_NODE_ID = 8;
|
||||
static const int MAX_INSTANCE_ID = 500;
|
||||
|
||||
static const int MAX_SYS_HTTP_NUM = 2;
|
||||
static const int MAX_USER_HTTP_NUM = 8;
|
||||
static const int MAX_ALL_HTTP_NUM = MAX_SYS_HTTP_NUM + MAX_USER_HTTP_NUM;
|
||||
|
||||
static const char* const PROJ_ROOT_FMT = "/data/logs/%s";
|
||||
static const char* const PROJ_LOG_ROOT_FMT = "/data/logs/%s/logs";
|
||||
static const char* const PROJ_LOG_FILENAME_FMT = "log_$pid_%Y%m%d.log";
|
||||
@ -44,6 +50,8 @@ namespace f8
|
||||
InitLog();
|
||||
f8::MsgQueue::Instance()->Init();
|
||||
f8::Timer::Instance()->Init();
|
||||
f8::TGLog::Instance()->Init(user_app_->GetPkgName(), false, 0);
|
||||
f8::HttpClientPool::Instance()->Init(MAX_ALL_HTTP_NUM, MAX_SYS_HTTP_NUM, MAX_USER_HTTP_NUM);
|
||||
user_app_->Init();
|
||||
return true;
|
||||
}
|
||||
@ -51,6 +59,8 @@ namespace f8
|
||||
void App::UnInit()
|
||||
{
|
||||
user_app_->UnInit();
|
||||
f8::TGLog::Instance()->UnInit();
|
||||
f8::HttpClientPool::Instance()->UnInit();
|
||||
f8::Timer::Instance()->UnInit();
|
||||
f8::MsgQueue::Instance()->UnInit();
|
||||
UnInitLog();
|
||||
@ -71,7 +81,7 @@ namespace f8
|
||||
f8::Timer::Instance()->Update();
|
||||
f8::MsgQueue::Instance()->Update();
|
||||
DispatchNetMsg();
|
||||
user_app->Update();
|
||||
user_app->Update(0);
|
||||
Schedule();
|
||||
}
|
||||
UnInit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user