Change recv to try_recv (#5533)
This commit is contained in:
parent
88ea950652
commit
d5fb493aa4
|
@ -131,7 +131,7 @@ impl SnapshotPackagerService {
|
|||
fn run(snapshot_receiver: &SnapshotPackageReceiver) -> Result<()> {
|
||||
let mut snapshot_package = snapshot_receiver.recv_timeout(Duration::from_secs(1))?;
|
||||
// Only package the latest
|
||||
while let Ok(new_snapshot_package) = snapshot_receiver.recv() {
|
||||
while let Ok(new_snapshot_package) = snapshot_receiver.try_recv() {
|
||||
snapshot_package = new_snapshot_package;
|
||||
}
|
||||
Self::package_snapshots(&snapshot_package)?;
|
||||
|
|
Loading…
Reference in New Issue