add Error::SeedFailed

This commit is contained in:
x
2023-08-30 10:33:01 +02:00
parent 4cf9878604
commit e481bd8bae
3 changed files with 5 additions and 2 deletions

View File

@@ -140,6 +140,9 @@ pub enum Error {
#[error("Channel timed out")]
ChannelTimeout,
#[error("Failed to reach any seeds")]
SeedFailed,
#[error("Network service stopped")]
NetworkServiceStopped,

View File

@@ -111,7 +111,7 @@ impl SeedSyncSession {
join_all(tasks).await;
if failed.load(Ordering::SeqCst) == settings.seeds.len() {
return Err(Error::ConnectFailed)
return Err(Error::SeedFailed)
}
// Seed process complete

View File

@@ -54,7 +54,7 @@ impl StoppableTask {
Arc::new(Self { stop_send, stop_recv, stop_barrier: CondVar::new() })
}
/// Stops the task
/// Stops the task. Will return when the process has fully closed.
pub async fn stop(&self) {
// Ignore any errors from this send
let _ = self.stop_send.send(()).await;