Skip to content
Open
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
20 changes: 18 additions & 2 deletions crates/payload/builder/src/prewarming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ impl BestTransactionsPrewarming {
advance(&mut ctx);
}

while let Ok(command) = ctx.commands_rx.recv() {
let handle_command = |ctx: &mut BestTransactionsPrewarmingContext<Txs, Provider>,
command: BestTransactionsCommand|
-> bool {
match command {
BestTransactionsCommand::Advance => {
advance(&mut ctx);
advance(ctx);
}
BestTransactionsCommand::Invalid {
invalid,
Expand All @@ -164,6 +166,20 @@ impl BestTransactionsPrewarming {
BestTransactionsCommand::Stop { drain_rx } => {
ctx.prewarm.stop();
drop(drain_rx);
return false;
}
}

true
};

while let Ok(command) = ctx.commands_rx.recv() {
if !handle_command(&mut ctx, command) {
return;
}

while let Ok(command) = ctx.commands_rx.try_recv() {
if !handle_command(&mut ctx, command) {
return;
}
}
Expand Down
Loading