Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/tasks/cache/bundle.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//! Bundler service responsible for fetching bundles and sending them to the simulator.
use crate::config::BuilderConfig;
use eyre::bail;
use init4_bin_base::{
deps::tracing::{Instrument, debug, debug_span, error, trace, warn},
deps::tracing::{Instrument, debug, debug_span, error, trace},
perms::SharedToken,
};
use oauth2::TokenResponse;
Expand Down Expand Up @@ -46,8 +47,7 @@ impl BundlePoller {
pub async fn check_bundle_cache(&mut self) -> eyre::Result<Vec<TxCacheBundle>> {
let bundle_url: Url = Url::parse(&self.config.tx_pool_url)?.join("bundles")?;
let Some(token) = self.token.read() else {
warn!("No token available, skipping bundle fetch");
return Ok(vec![]);
bail!("No token available, skipping bundle fetch");
};

self.client
Expand Down Expand Up @@ -89,10 +89,12 @@ impl BundlePoller {
.await
.inspect_err(|err| debug!(%err, "Error fetching bundles"))
{
let _guard = span.entered();
debug!(count = ?bundles.len(), "found bundles");
for bundle in bundles.into_iter() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add a trace or debug log for the bundle id of each bundle?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should be done in the cache on ingestion, rather than here

if let Err(err) = outbound.send(bundle) {
error!(err = ?err, "Failed to send bundle - channel is dropped");
break;
}
}
}
Expand Down