提交 d284cba5 authored 作者: blu's avatar blu

big refacting of communitation architect

上级 6b9dec0a
...@@ -210,7 +210,7 @@ class EvDaemon{ ...@@ -210,7 +210,7 @@ class EvDaemon{
return ret; return ret;
} }
void subSystemsMgr() { void setupSubsystems() {
thMon = thread([this](){ thMon = thread([this](){
int ret = 0; int ret = 0;
while(true) { while(true) {
...@@ -220,15 +220,18 @@ class EvDaemon{ ...@@ -220,15 +220,18 @@ class EvDaemon{
if(ret != 0) { if(ret != 0) {
//TODO //TODO
spdlog::error("evdaemon {} failed to parse new configuration, check prevous log for details", devSn);
}else{ }else{
bReload = false; bReload = false;
} }
if(this->bColdStart) { if(this->bColdStart) {
// TODO: // TODO:
this->bColdStart = false;
// for peers to connect
this_thread::sleep_for(chrono::seconds(5));
} }
if(this->bBootstrap) { if(this->bBootstrap) {
// todo
startSubSystems(); startSubSystems();
} }
} }
...@@ -447,7 +450,7 @@ class EvDaemon{ ...@@ -447,7 +450,7 @@ class EvDaemon{
public: public:
void run(){ void run(){
subSystemsMgr(); setupSubsystems();
// get config // get config
svr.Get("/info", [this](const Request& req, Response& res){ svr.Get("/info", [this](const Request& req, Response& res){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论