Skip to content

Commit

Permalink
per review comments; No logical code change
Browse files Browse the repository at this point in the history
  • Loading branch information
renukamanavalan committed Jun 21, 2022
1 parent ec671c0 commit ae60e1b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions src/sonic-eventd/src/eventd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,24 +214,24 @@ capture_service::do_capture()
switch(cap_state) {
case CAP_STATE_INIT:
{
bool add = true;
init_cnt--;
pre_exist_id_t::iterator it = m_pre_exist_id.find(rid);

if (it != m_pre_exist_id.end()) {
if (seq <= it->second) {
/* Duplicate; Later/same seq in cache. */
add = false;
bool add = true;
init_cnt--;
pre_exist_id_t::iterator it = m_pre_exist_id.find(rid);

if (it != m_pre_exist_id.end()) {
if (seq <= it->second) {
/* Duplicate; Later/same seq in cache. */
add = false;
}
if (seq >= it->second) {
/* new one; This runtime ID need not be checked again */
m_pre_exist_id.erase(it);
}
}
if (seq >= it->second) {
/* new one; This runtime ID need not be checked again */
m_pre_exist_id.erase(it);
if (add) {
m_events.push_back(evt_str);
}
}
if (add) {
m_events.push_back(evt_str);
}
}
if(m_pre_exist_id.empty() || (init_cnt <= 0)) {
/* Init check is no more needed. */
pre_exist_id_t().swap(m_pre_exist_id);
Expand Down
4 changes: 2 additions & 2 deletions src/sonic-eventd/tests/eventd_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ TEST(eventd, service)
* It runs proxy & capture service
* It uses its own zmq context
*/
thread thrSvc(&run_eventd_service);
thread thread_service(&run_eventd_service);

/* Need client side service to interact with server side */
EXPECT_EQ(0, service.init_client(zctx));
Expand Down Expand Up @@ -641,7 +641,7 @@ TEST(eventd, service)

service.close_service();

thrSvc.join();
thread_service.join();

zmq_ctx_term(zctx);
printf("Service TEST completed\n");
Expand Down

0 comments on commit ae60e1b

Please sign in to comment.