Skip to content

Commit 64037e5

Browse files
authored
fix(hermes): ignore no subscriber error on broadcast (#1492)
This change ignores the errors appearing when there are no subsribers to price updates. The issue was fixed before and was missed during the refactor.
1 parent 4445c73 commit 64037e5

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

apps/hermes/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/hermes/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hermes"
3-
version = "0.5.6"
3+
version = "0.5.7"
44
description = "Hermes is an agent that provides Verified Prices from the Pythnet Pyth Oracle."
55
edition = "2021"
66

apps/hermes/src/state/aggregate.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -323,27 +323,27 @@ where
323323
// Update the aggregate state
324324
let mut aggregate_state = self.into().data.write().await;
325325

326-
// Check if the update is new or out of order
327-
match aggregate_state.latest_completed_slot {
326+
// Send update event to subscribers. We are purposefully ignoring the result
327+
// because there might be no subscribers.
328+
let _ = match aggregate_state.latest_completed_slot {
328329
None => {
329330
aggregate_state.latest_completed_slot.replace(slot);
330331
self.into()
331332
.api_update_tx
332-
.send(AggregationEvent::New { slot })?;
333+
.send(AggregationEvent::New { slot })
333334
}
334335
Some(latest) if slot > latest => {
335336
self.prune_removed_keys(message_state_keys).await;
336337
aggregate_state.latest_completed_slot.replace(slot);
337338
self.into()
338339
.api_update_tx
339-
.send(AggregationEvent::New { slot })?;
340+
.send(AggregationEvent::New { slot })
340341
}
341-
_ => {
342-
self.into()
343-
.api_update_tx
344-
.send(AggregationEvent::OutOfOrder { slot })?;
345-
}
346-
}
342+
_ => self
343+
.into()
344+
.api_update_tx
345+
.send(AggregationEvent::OutOfOrder { slot }),
346+
};
347347

348348
aggregate_state.latest_completed_slot = aggregate_state
349349
.latest_completed_slot

0 commit comments

Comments
 (0)