Skip to content

Commit

Permalink
Fix cluster piece getter
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Jan 14, 2025
1 parent e0a3f16 commit 5619ee3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ pub(super) async fn controller(
);

let fut = farmer_cache_worker
.run(piece_getter.downgrade())
.run(piece_getter)
.instrument(info_span!("", %cache_group));

async move {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@ where

let farmer_cache_worker_fut = run_future_in_dedicated_thread(
{
// Piece cache worker uses piece getter, while piece getter uses piece cache, which
// piece cache worker depends on. Use weak reference to break the cycle and allow worker
// to exit when last piece cache instance is dropped.
let future = farmer_cache_worker.run(piece_getter.downgrade());

move || future
Expand Down

0 comments on commit 5619ee3

Please sign in to comment.