Skip to content
Snippets Groups Projects
Commit 886fac66 authored by Giacomo Strangolino's avatar Giacomo Strangolino
Browse files

check push event event data err flag and print error if true

parent bf7d7f4f
No related branches found
No related tags found
No related merge requests found
...@@ -131,20 +131,25 @@ CuData CaTgDbCacheMgr::getToken() const { ...@@ -131,20 +131,25 @@ CuData CaTgDbCacheMgr::getToken() const {
} }
void CaTgDbCacheMgr::push_event(Tango::AttrConfEventData *ed) { void CaTgDbCacheMgr::push_event(Tango::AttrConfEventData *ed) {
std::string dnam = d->tgu.m_dev_get_name(ed->device); if(ed->err) {
if(dnam.length() == 0) d->log->write(d->ltag, "push_event error: " + d->tgu.tg_strerror(ed->errors) + " on attribute " + ed->attr_name.c_str());
d->log->write("ca-tg-db-cache-mgr", "push_event: dev->name failed: " + d->tgu.error); }
CuData co;
d->tgu.m_fill_from_attconf(ed->attr_conf, co);
d->log->write(d->ltag, "configuration changed for " + ed->attr_name + ": " + datos(co), CuLog::LevelInfo );
bool redisok = d->redisu.update(ed->attr_name, co);
if(!redisok)
d->log->write(d->ltag, "error updating conf data on redis: " + d->redisu.error());
else { else {
CuData out; std::string dnam = d->tgu.m_dev_get_name(ed->device);
d->redisu.get(ed->attr_name, out); if(dnam.length() == 0)
printf("CaTgDbCacheMgr::push_event read just updated data for \e[1;36m%s\e[0m : \e[1;32m%s\e[0m\n", d->log->write("ca-tg-db-cache-mgr", "push_event: dev->name failed: " + d->tgu.error);
ed->attr_name.c_str(), datos(out)); CuData co;
d->tgu.m_fill_from_attconf(ed->attr_conf, co);
d->log->write(d->ltag, "configuration changed for " + ed->attr_name + ": " + datos(co), CuLog::LevelInfo );
bool redisok = d->redisu.update(ed->attr_name, co);
if(!redisok)
d->log->write(d->ltag, "error updating conf data on redis: " + d->redisu.error());
else {
CuData out;
d->redisu.get(ed->attr_name, out);
printf("CaTgDbCacheMgr::push_event read just updated data for \e[1;36m%s\e[0m : \e[1;32m%s\e[0m\n",
ed->attr_name.c_str(), datos(out));
}
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment