From 8f567ed6b45e6776db30982e10e0ca7b44b9537d Mon Sep 17 00:00:00 2001 From: VC Date: Thu, 9 Feb 2023 15:18:12 +0100 Subject: [PATCH 1/2] chore: bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3766b22..0264e63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1316,7 +1316,7 @@ dependencies = [ [[package]] name = "scootaloo" -version = "1.1.5" +version = "1.1.6" dependencies = [ "base64", "clap", diff --git a/Cargo.toml b/Cargo.toml index b97c17b..8379cf8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "scootaloo" -version = "1.1.5" +version = "1.1.6" authors = ["VC "] edition = "2021" From 83c398cebf49b14e25643b49235ca25c3de2b0d0 Mon Sep 17 00:00:00 2001 From: VC Date: Thu, 9 Feb 2023 15:19:22 +0100 Subject: [PATCH 2/2] feat: wait 1 full sec between loop when uploading big media --- src/util.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util.rs b/src/util.rs index 0e5f063..c681307 100644 --- a/src/util.rs +++ b/src/util.rs @@ -15,6 +15,7 @@ use std::error::Error; use tokio::{ fs::{create_dir_all, remove_file, File}, io::copy, + time::{sleep, Duration}, }; /// Generate associative table between media ids and tweet extended entities @@ -85,6 +86,7 @@ pub async fn generate_media_ids( /// Wait on uploaded medias when necessary async fn wait_until_uploaded(client: &Mastodon, id: &str) -> Result { loop { + sleep(Duration::from_secs(1)).await; let res = client.get_media(id.to_string()).await; return match res { Ok(res) => Ok(res.json.id),