Skip to content

Commit

Permalink
Revert "Start next plotting process in a pool when one of the attempt…
Browse files Browse the repository at this point in the history
…s succeeded"

This reverts commit 8689b56.
  • Loading branch information
nazar-pc committed Jan 9, 2025
1 parent 9ce216e commit 45b110c
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions crates/subspace-farmer/src/plotter/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
use crate::plotter::{Plotter, SectorPlottingProgress};
use async_trait::async_trait;
use event_listener::Event;
use futures::channel::mpsc;
use futures::future;
use std::any::type_name_of_val;
use std::pin::pin;
use std::time::Duration;
use subspace_core_primitives::sectors::SectorIndex;
use subspace_core_primitives::PublicKey;
Expand All @@ -21,7 +18,6 @@ use tracing::{error, trace};
pub struct PoolPlotter {
plotters: Vec<Box<dyn Plotter + Send + Sync>>,
retry_interval: Duration,
notification: Event,
}

#[async_trait]
Expand Down Expand Up @@ -70,7 +66,6 @@ impl Plotter for PoolPlotter {
)
.await
{
self.notification.notify_relaxed(1);
return;
}
}
Expand All @@ -79,11 +74,7 @@ impl Plotter for PoolPlotter {
retry_interval = ?self.retry_interval,
"All plotters are busy, will wait and try again later"
);
future::select(
pin!(tokio::time::sleep(self.retry_interval)),
self.notification.listen(),
)
.await;
tokio::time::sleep(self.retry_interval).await;
}
}

Expand All @@ -108,7 +99,6 @@ impl Plotter for PoolPlotter {
)
.await
{
self.notification.notify_relaxed(1);
return true;
}
}
Expand All @@ -123,7 +113,6 @@ impl PoolPlotter {
Self {
plotters,
retry_interval,
notification: Event::new(),
}
}
}

0 comments on commit 45b110c

Please sign in to comment.