Преглед изворни кода

client: nit: no need to specify tokio sleep

Justin Tracey пре 9 месеци
родитељ
комит
020aeedb68
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5 5
      src/bin/mgen-client.rs

+ 5 - 5
src/bin/mgen-client.rs

@@ -191,7 +191,7 @@ async fn reader(
                         let mut res = client.get(url.clone()).await;
                         while res.is_err() {
                             log!("Error fetching: {}", res.unwrap_err());
-                            tokio::time::sleep(retry).await;
+                            sleep(retry).await;
                             res = client.get(url.clone()).await;
                         }
                     });
@@ -260,7 +260,7 @@ async fn uploader(
             let mut res = client.request(request).await;
             while res.is_err() {
                 log!("{},{},Error uploading: {}", user, url, res.unwrap_err());
-                tokio::time::sleep(retry).await;
+                sleep(retry).await;
                 res = client.get(url.clone()).await;
             }
         }
@@ -324,7 +324,7 @@ async fn socket_updater(
                     str_params.recipient,
                     e
                 );
-                tokio::time::sleep(retry).await;
+                sleep(retry).await;
                 continue;
             }
             Err(MessengerError::Fatal(e)) => return e,
@@ -339,7 +339,7 @@ async fn socket_updater(
                     str_params.recipient,
                     e
                 );
-                tokio::time::sleep(retry).await;
+                sleep(retry).await;
                 continue;
             }
         };
@@ -379,7 +379,7 @@ async fn manage_conversation(
     mut state_from_reader: StateFromReader,
     mut state_to_writer: StateToWriter<MessageHolder>,
 ) {
-    tokio::time::sleep(Duration::from_secs_f64(config.bootstrap)).await;
+    sleep(Duration::from_secs_f64(config.bootstrap)).await;
     log!("{},{},awake", &config.user, &config.group);
 
     let mut rng = Xoshiro256PlusPlus::from_entropy();