Skip to content

Commit

Permalink
chore: log the number of caches and farms
Browse files Browse the repository at this point in the history
  • Loading branch information
tedious committed Jul 26, 2024
1 parent 79c9221 commit 4ac9713
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions crates/subspace-farmer/src/cluster/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ async fn send_identify_broadcast<C>(
) where
C: PieceCache,
{
let Some(cache_id) = caches_details.first().map(|cache| cache.cache_id) else {
let cache_count = caches_details.len();
if cache_count == 0 {
// No caches, nothing to do
return;
};
Expand All @@ -348,7 +349,7 @@ async fn send_identify_broadcast<C>(
.broadcast(&ClusterCacheIdentifyBroadcast { details }, cache_group)
.await
{
warn!(%cache_id, %error, "Failed to send cache identify notification");
warn!(%cache_count, %error, "Failed to send cache identify notification");
};
}

Expand Down
3 changes: 2 additions & 1 deletion crates/subspace-farmer/src/cluster/farmer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,8 @@ async fn send_identify_broadcast(nats_client: &NatsClient, farms_details: &[Farm
)
.await
{
warn!(%farm_id_string, %error, "Failed to send farmer identify notification");
let farm_count = farms_details.len();
warn!(%farm_id_string, %farm_count, %error, "Failed to send farmer identify notification");
}
}

Expand Down

0 comments on commit 4ac9713

Please sign in to comment.