mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-01-22 10:44:36 +00:00
Keep a longer of queue of blocks to get
This commit is contained in:
parent
44c7ad4992
commit
51e67163a8
3 changed files with 9 additions and 7 deletions
|
@ -123,7 +123,7 @@ impl Service<ChainSvcRequest> for OurChainSvc {
|
|||
}
|
||||
}
|
||||
|
||||
#[tokio::main(flavor = "multi_thread", worker_threads = 12)]
|
||||
#[tokio::main(flavor = "multi_thread")]
|
||||
async fn main() {
|
||||
tracing_subscriber::fmt()
|
||||
.with_max_level(Level::DEBUG)
|
||||
|
@ -151,7 +151,7 @@ async fn main() {
|
|||
.await
|
||||
.unwrap();
|
||||
|
||||
sleep(Duration::from_secs(15)).await;
|
||||
sleep(Duration::from_secs(17)).await;
|
||||
|
||||
loop {
|
||||
let mut buffer = download_blocks(
|
||||
|
@ -162,8 +162,8 @@ async fn main() {
|
|||
buffer_size: 50_000_000,
|
||||
in_progress_queue_size: 30_000_000,
|
||||
check_client_pool_interval: Duration::from_secs(20),
|
||||
target_batch_size: 1_000_000,
|
||||
initial_batch_size: 100,
|
||||
target_batch_size: 2_000_000,
|
||||
initial_batch_size: 10,
|
||||
},
|
||||
);
|
||||
|
||||
|
@ -175,6 +175,8 @@ async fn main() {
|
|||
)
|
||||
}
|
||||
|
||||
panic!();
|
||||
|
||||
sleep(Duration::from_secs(2)).await;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -363,7 +363,7 @@ where
|
|||
client: ClientPoolDropGuard<N>,
|
||||
) {
|
||||
if self.chain_entry_task.len() < 2
|
||||
&& chain_tracker.block_requests_queued(self.amount_of_blocks_to_request) < 30
|
||||
&& chain_tracker.block_requests_queued(self.amount_of_blocks_to_request) < 500
|
||||
&& chain_tracker.should_ask_for_next_chain_entry(&client.info.pruning_seed)
|
||||
{
|
||||
let history = chain_tracker.get_simple_history();
|
||||
|
@ -517,7 +517,7 @@ where
|
|||
let mut amount_of_blocks_to_request_updated_at = 0;
|
||||
|
||||
let mut check_client_pool_interval = interval(self.config.check_client_pool_interval);
|
||||
check_client_pool_interval.set_missed_tick_behavior(MissedTickBehavior::Delay);
|
||||
check_client_pool_interval.set_missed_tick_behavior(MissedTickBehavior::Skip);
|
||||
|
||||
loop {
|
||||
tokio::select! {
|
||||
|
|
|
@ -10,7 +10,7 @@ default = ["borsh"]
|
|||
borsh = ["dep:borsh", "monero-pruning/borsh"]
|
||||
|
||||
[dependencies]
|
||||
cuprate-helper = { path = "../../helper" }
|
||||
cuprate-helper = { path = "../../helper", features = ["asynch"] }
|
||||
monero-wire = { path = "../../net/monero-wire", features = ["tracing"] }
|
||||
monero-pruning = { path = "../../pruning" }
|
||||
|
||||
|
|
Loading…
Reference in a new issue