Skip to content

Commit

Permalink
If discard_stale = true, don't interpret stale as ERROR when rolling up
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Symington <andrew.c.symington@gmail.com>
  • Loading branch information
asymingt committed Sep 23, 2023
1 parent 24fb79a commit 9378ae6
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,15 @@ class GenericAnalyzerBase : public Analyzer

// Header is not stale unless all subs are
if (all_stale) {
header_status->level = diagnostic_msgs::msg::DiagnosticStatus::STALE;
// If we elect to discard stale items, then it signals that the absence of an item
// is not considered problematic, so we should allow empty queues to roll up as OK.
if (discard_stale_) {
header_status->level = diagnostic_msgs::msg::DiagnosticStatus::OK;
} else {
header_status->level = diagnostic_msgs::msg::DiagnosticStatus::STALE;
}
} else if (header_status->level == diagnostic_msgs::msg::DiagnosticStatus::STALE) {
header_status->level = 2;
header_status->level = diagnostic_msgs::msg::DiagnosticStatus::ERROR;
}

header_status->message = valToMsg(header_status->level);
Expand Down

0 comments on commit 9378ae6

Please sign in to comment.