x 2 лет назад
Родитель
Сommit
e481bd8bae
3 измененных файлов с 5 добавлено и 2 удалено
  1. 3 0
      src/error.rs
  2. 1 1
      src/net/session/seedsync_session.rs
  3. 1 1
      src/system/stoppable_task.rs

+ 3 - 0
src/error.rs

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

+ 1 - 1
src/net/session/seedsync_session.rs

@@ -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

+ 1 - 1
src/system/stoppable_task.rs

@@ -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;