eis/eqpalg/eqpalg.cpp
Huamonarch b8596d311f Remove rm -rf of MapRuleStat_boost.mmap on startup
Dynamic shared-memory vectors no longer cause segfaults from
unbounded growth, so the brute-force file deletion on every
start is unnecessary. Consistent with e21b2af which removed
the same pattern for TaskData_boost.mmap.
2026-05-13 09:47:52 +08:00

54 lines
1.6 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <eqpalg/define/public.h>
#include <eqpalg/eqpalg.h>
#include <glob/GlobDefine.h>
#include <utility/IniProperty.h>
#include <memory>
#include <string>
#include "mix_cc/debug/pre_define.h"
using namespace baosight;
ProcessType glob_process_type;
MIX_CC_TEST_DEBUG_MODE
eqpalg::eqpalg() { logger_ = std::make_unique<LOG>("eqpalg"); }
eqpalg::~eqpalg() {
logger_->Info() << "eqpalg::~eqpalg()"
<< "Destruct" << endl;
}
int eqpalg::start() {
logger_->Info() << "start eqpalg." << endl;
// 启动ConnectionMag这个一定不要去除否则内部很多邹师傅写的库都无法正常工作
con_mag_ = std::make_shared<ConnectionMag>();
con_mag_->dbLogin();
try {
auto module_name = name();
// 根据模块名称,设置全局变量线程类型
if (module_name == "eqpalg-mon") {
glob_process_type = ProcessType::kMon;
} else if (module_name == "eqpalg-cron") {
glob_process_type = ProcessType::kCron;
} else if (module_name == "eqpalg-task") {
glob_process_type = ProcessType::kTask;
} else {
glob_process_type = ProcessType::kNull;
}
eqpalg_server = new EqpAlgICEI();
this->add(string("baosight/") + name(), eqpalg_server);
} catch (::Ice::LocalException& e) {
logger_->Error() << "Can not add baosight/eqpalg, error: " << e.what()
<< ",location:" << BOOST_CURRENT_LOCATION << endl;
return (-1);
} catch (std::exception& e) {
logger_->Error() << e.what() << ",location:" << BOOST_CURRENT_LOCATION
<< endl;
}
return 0;
}
PACE_PLATFORM_SERVER_INSTALL(eqpalg, APPVERSION);