thread::sleep blocking fix + better print system

This commit is contained in:
Neshura 2023-09-01 00:40:59 +02:00
parent 19c41eff6b
commit a17de20b2b
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
2 changed files with 26 additions and 20 deletions
src/config

View file

@ -3,7 +3,6 @@ use std::{
fs::{self, OpenOptions},
io::Write,
path::Path,
thread::sleep,
time,
};
@ -17,6 +16,7 @@ use lemmy_db_schema::{
ListingType,
};
use serde_derive::{Deserialize, Serialize};
use tokio::time::sleep;
use url::Url;
use crate::CLIENT;
@ -161,7 +161,7 @@ impl Config {
post_queue.push((new_post, prev_data));
}
sleep(time::Duration::from_millis(100)); // Should prevent dos-ing J-Novel servers
sleep(time::Duration::from_millis(100)).await; // Should prevent dos-ing J-Novel servers
i += 1;
}