Address feedback from Niklas

This commit is contained in:
James Wilson
2021-08-11 16:59:11 +01:00
parent f089ad1758
commit f26b39ac63
15 changed files with 62 additions and 38 deletions
@@ -1,10 +1,10 @@
use super::aggregator::Aggregator;
use super::inner_loop;
use common::EitherSink;
use futures::{Sink, SinkExt, StreamExt};
use inner_loop::FromShardWebsocket;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use common::EitherSink;
#[derive(Clone)]
pub struct AggregatorSet(Arc<AggregatorSetInner>);
@@ -42,7 +42,7 @@ impl AggregatorSet {
// if we don't actually need it.
if self.0.aggregators.len() == 1 {
let sub = self.0.aggregators[0].subscribe_shard();
return EitherSink::a(sub)
return EitherSink::a(sub);
}
let mut conns: Vec<_> = self
@@ -438,7 +438,7 @@ impl InnerLoop {
// (which is helpful for the UI as it tries to maintain a sorted list of nodes). The chunk
// size is the max number of node info we fit into 1 message; smaller messages allow the UI
// to react a little faster and not have to wait for a larger update to come in. A chunk size
// of 64 means each mesage is ~32k.
// of 64 means each message is ~32k.
use rayon::prelude::*;
let all_feed_messages: Vec<_> = new_chain
.nodes_slice()
+1 -1
View File
@@ -110,7 +110,7 @@ impl Locator {
// Return location quickly if it's cached:
let cached_loc = {
let cache_reader = self.cache.read();
cache_reader.get(&ip).map(|o| o.clone())
cache_reader.get(&ip).cloned()
};
if let Some(loc) = cached_loc {
return Ok(loc);
+1 -1
View File
@@ -213,7 +213,7 @@ where
// connection anyway.
let msg_info = tokio::select! {
msg_info = ws_recv.receive_data(&mut bytes) => msg_info,
_ = &mut recv_closer_rx => { break }
_ = &mut recv_closer_rx => break
};
// Handle the socket closing, or errors receiving the message.