Skip to content

Commit

Permalink
Fix farmer piece getter
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Feb 29, 2024
1 parent 2b9480e commit 1fd384b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/subspace-farmer/src/utils/farmer_piece_getter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ where
.in_progress_pieces
.lock()
.entry(piece_index)
.or_insert_with(|| {
.and_modify(|_mutex| {
local_in_progress_piece_guard.take();
Arc::clone(&in_progress_piece_mutex)
})
.or_insert_with(|| Arc::clone(&in_progress_piece_mutex))
.clone();

// If piece is already in progress, just wait for it
Expand Down Expand Up @@ -174,10 +174,10 @@ where
.in_progress_pieces
.lock()
.entry(piece_index)
.or_insert_with(|| {
.and_modify(|_mutex| {
local_in_progress_piece_guard.take();
Arc::clone(&in_progress_piece_mutex)
})
.or_insert_with(|| Arc::clone(&in_progress_piece_mutex))
.clone();

// If piece is already in progress, wait for it to see if it was successful
Expand Down Expand Up @@ -273,10 +273,10 @@ where
.in_progress_pieces
.lock()
.entry(piece_index)
.or_insert_with(|| {
.and_modify(|_mutex| {
local_in_progress_piece_guard.take();
Arc::clone(&in_progress_piece_mutex)
})
.or_insert_with(|| Arc::clone(&in_progress_piece_mutex))
.clone();

// If piece is already in progress, wait for it to see if it was successful
Expand Down

0 comments on commit 1fd384b

Please sign in to comment.