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

revisiting all TODOs

上级 e4c1e6c7
......@@ -26,7 +26,7 @@ string _config_default_tmpl = "{\"time\":0,\"code\":0,\"data\":{\"<SN_MGR>\":{\"
const string _sn_tmpl[] = {"<SN_MGR>", "<SN_PULLER>", "<SN_PUSHER>", "<SN_SLICER>", "<SN_ML>"};
const string _addr_tmpl[] = {"<ADDR_CAMERA>"};
// TODO:
// TODO: move to evcloudsvc ?
string getStrRand(int length)
{
static bool bRand = false;
......
......@@ -250,8 +250,8 @@ private:
}
if(this->configMap.count(k) ^ this->peerData["config"].count(k)) {
spdlog::warn("evcloudsvc inconsistent configuration for cluster {}", k);
// TODO: handle this situation gracefully.
// rmeove both
// TODO: improvements?
// remove both
this->configMap.erase(k);
this->peerData["config"].erase(k);
}
......@@ -491,7 +491,6 @@ private:
}
}
else {
// TODO:
spdlog::warn("evcloudsvc {} received unknown meta {} from {}", devSn, meta, selfId);
}
}
......@@ -805,15 +804,13 @@ public:
this->configMap["mod2mgr"].erase(k);
}
}
// TODO: clear peerData
this->configMap.erase(sn);
this->peerData.erase(sn);
spdlog::info("evcloudsvc removed sn: {}", sn);
// TODO: send config diff to sn
int iret = LVDB::setValue(this->configMap, KEY_CONFIG_MAP);
}
res.set_content(this->configMap.dump(), "text/json");
});
......
......@@ -520,7 +520,6 @@ private:
}
}
else {
// TODO:
spdlog::warn("evdaemon {} received unknown meta {} from {}", devSn, meta, selfId);
}
}
......@@ -579,7 +578,6 @@ private:
}
if(bBootstrap) {
// TODO: wait for previous started modules to connecting
startSubSystems();
}
else {
......@@ -665,8 +663,6 @@ public:
else {
json info;
info["sn"] = sn;
// TODO:
info["lastboot"] = chrono::duration_cast<chrono::seconds>(chrono::system_clock::now().time_since_epoch()).count();
LVDB::setSn(info);
}
......@@ -689,8 +685,6 @@ public:
LVDB::setLocalConfig(newConfig);
spdlog::info("evmgr new config: {}", newConfig.dump());
// TODO: restart other components
//
}
catch(exception &e) {
ret.clear();
......
......@@ -112,8 +112,6 @@ private:
addr = "tcp://*:" + to_string(config["portRouter"]);
// setup zmq
// TODO: connect to cloud
// router service
pRouterCtx = zmq_ctx_new();
pRouter = zmq_socket(pRouterCtx, ZMQ_ROUTER);
......
......@@ -181,7 +181,6 @@ private:
int init()
{
int ret = 0;
// TODO: req config
bool found = false;
try {
spdlog::info("evmlmotion boot config: {} -> {}", selfId, config.dump());
......@@ -364,7 +363,6 @@ private:
ret = z_send_multiple(pDealer, body);
if(ret < 0) {
spdlog::error("evmlmotion {} failed to send multiple: {}", selfId, zmq_strerror(zmq_errno()));
//TODO:
}
else {
spdlog::info("evmlmotion {} sent hello to router: {}", selfId, mgrSn);
......@@ -518,7 +516,6 @@ private:
cv::absdiff(gray, avg, thresh);
avg = gray.clone();
if(!detect || fent < detPara.entropy) {
return;
}
......
......@@ -116,7 +116,6 @@ private:
{
int ret = 0;
{
// TODO: disable message response before openned input stream
unique_lock<mutex> lk(this->mutMsg);
this->cvMsg.wait(lk, [this] {return this->gotFormat;});
}
......@@ -124,7 +123,7 @@ private:
spdlog::info("evpuller {} got inputformat", selfId);
try {
// rep framectx
// TODO: verify sender id
// TODO: verify sender id?
string sMeta = body2str(v[1]);
string peerId = body2str(v[0]);
auto meta = json::parse(sMeta);
......@@ -414,7 +413,6 @@ protected:
free(pAVFmtCtxBytes);
}
// TODO:
if(ret < 0 && !bStopSig) {
// reconnect
}
......
......@@ -179,7 +179,6 @@ private:
ret = z_send_multiple(pDealer, body);
if(ret < 0) {
spdlog::error("evpusher {} {} failed to send multiple: {}", devSn, iid, zmq_strerror(zmq_errno()));
//TODO:
}
else {
spdlog::info("evpusher {} sent hello to router: {}", selfId, mgrSn);
......
......@@ -394,7 +394,6 @@ private:
ret = z_send_multiple(pDealer, body);
if(ret < 0) {
spdlog::error("evslicer {} failed to send multiple: {}", selfId, zmq_strerror(zmq_errno()));
//TODO:
}
else {
spdlog::info("evslicer {} sent hello to router: {}", selfId, mgrSn);
......@@ -929,7 +928,6 @@ public:
auto tse = jEvt["end"].get<long>();
long offsetS = 0;
long offsetE = 0;
// TODO: async
if(tss < this->bootTime) {
spdlog::warn("evslicer {} should we discard old msg? {} < bootTime {}", selfId, evt, this->bootTime);
......@@ -1004,8 +1002,7 @@ public:
cvEvent.notify_one();
}
}else if(resp["code"] == 6) {
// cloud storage issue
// TODO:
// TODO: cloud storage issue. need stratigy policy
}
}
}
......
......@@ -154,7 +154,6 @@ int getPeerId(string modName, json& modElem, string &peerId, string &peerName)
json getModuleGidsFromCfg(string sn, json &data, string caller, int ipcIdx)
{
json ret;
bool hasError = false;
ret["code"] = 0;
ret["msg"] = "ok";
ret["data"] = json();
......@@ -162,7 +161,6 @@ json getModuleGidsFromCfg(string sn, json &data, string caller, int ipcIdx)
try {
// lock_guard<mutex> lock(cacheLock);
string peerId;
pid_t pid;
for(auto &[k,v]:data.items()) {
if(v.count("sn") == 0|| v["sn"].size() == 0 || v.count("ipcs") == 0 || v["ipcs"].size() == 0) {
msg += fmt::format( "\t\tcluster {} has no sn/ipcs field {}:{}", v.dump(), __FILE__, __LINE__);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论