Skip to content

Commit bdc40fe

Browse files
authored
fix task_price_feeds_metadata_updater (#1449)
1 parent 729b18e commit bdc40fe

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

hermes/src/network/pythnet.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,19 @@ pub async fn spawn(opts: RunOptions, state: Arc<State>) -> Result<()> {
325325
let price_feeds_state = state.clone();
326326
let mut exit = crate::EXIT.subscribe();
327327
tokio::spawn(async move {
328+
// Run fetch and store once before the loop
329+
if let Err(e) = fetch_and_store_price_feeds_metadata(
330+
price_feeds_state.as_ref(),
331+
&opts.pythnet.mapping_addr,
332+
&rpc_client,
333+
)
334+
.await
335+
{
336+
tracing::error!(
337+
"Error in initial fetching and storing price feeds metadata: {}",
338+
e
339+
);
340+
}
328341
loop {
329342
tokio::select! {
330343
_ = exit.changed() => break,

0 commit comments

Comments
 (0)