perf: speed-up musicDB load

This commit is contained in:
mokurin000
2025-08-01 03:50:36 +08:00
parent 68e8a6e005
commit 7fe64ac4cd
3 changed files with 27 additions and 5 deletions

View File

@@ -1,4 +1,7 @@
use std::sync::atomic::{AtomicBool, Ordering};
use std::{
io::stdout,
sync::atomic::{AtomicBool, Ordering},
};
use nyquest_preset::nyquest::ClientBuilder;
use palc::Parser;
@@ -116,10 +119,17 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
}
commands::Commands::QRLogin { ref qrcode_content } => {
let qrcode = QRCode { qrcode_content };
match qrcode.login(&client).await {
let resp = qrcode.login(&client).await;
match &resp {
Ok(user_id) => info!("login succeed: {user_id}"),
Err(e) => error!("login failed: {e}"),
}
if !human_readable {
let lock = stdout().lock();
serde_json::to_writer_pretty(lock, &resp)?;
}
}
commands::Commands::AuthLite { title_ver, variant } => {