Skip to content

Commit

Permalink
feat: allow more stale price stats
Browse files Browse the repository at this point in the history
  • Loading branch information
alextes committed Jun 23, 2024
1 parent b539bb0 commit d1c9bdf
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/phoenix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,21 @@ async fn run_alarm_loop(last_checked: Arc<Mutex<DateTime<Utc>>>) {

loop {
for phoenix in phoenixes.iter_mut() {
if phoenix.is_age_over_limit() {
if phoenix.name == "eth-price-stats" {
let limit = Duration::minutes(12);
let age = Utc::now() - phoenix.last_seen;
debug!(
name = "eth-price-stats",
age = age.num_seconds(),
limit = limit.num_seconds(),
"checking age"
);
if age >= limit {
alarm.fire_dashboard_stalled("eth-price-stats").await;
}
}

if phoenix.name != "eth-price-stats" && phoenix.is_age_over_limit() {
alarm.fire_dashboard_stalled(phoenix.name).await;
}

Expand Down

0 comments on commit d1c9bdf

Please sign in to comment.