Skip to content

Commit

Permalink
Remove if and log messages for event_publish (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
zbud-msft authored Sep 14, 2022
1 parent 74ff2dc commit 460a7ec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions orchagent/crmorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,7 @@ void CrmOrch::checkCrmThresholds()
SWSS_LOG_WARN("%s THRESHOLD_EXCEEDED for %s %u%% Used count %u free count %u",
res.name.c_str(), threshType.c_str(), percentageUtil, cnt.usedCounter, cnt.availableCounter);

if (0 != event_publish(m_events_handle, "chk_crm_threshold", &params)) {
SWSS_LOG_WARN("Failed to publish event for if-state");
}
event_publish(m_events_handle, "chk_crm_threshold", &params);

res.exceededLogCounter++;
}
Expand Down
4 changes: 1 addition & 3 deletions orchagent/pfcwdorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,9 +952,7 @@ void PfcWdSwOrch<DropHandler, ForwardHandler>::report_pfc_storm(
id,
entry->portId);

if (0 != event_publish(m_events_handle, "pfc-storm", &params)) {
SWSS_LOG_WARN("Failed to publish event for pfc-storm");
}
event_publish(m_events_handle, "pfc-storm", &params);
}

template <typename DropHandler, typename ForwardHandler>
Expand Down
4 changes: 1 addition & 3 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2540,9 +2540,7 @@ bool PortsOrch::setHostIntfsOperStatus(const Port& port, bool isUp) const
isUp ? "UP" : "DOWN", port.m_alias.c_str());

event_params_t params = {{"ifname",port.m_alias},{"status",isUp ? "up" : "down"}};
if (0 != event_publish(m_events_handle, "if-state", &params)) {
SWSS_LOG_WARN("Failed to publish event for if-state");
}
event_publish(m_events_handle, "if-state", &params);
return true;
}

Expand Down

0 comments on commit 460a7ec

Please sign in to comment.