log: only log succeed userid

This commit is contained in:
mokurin000
2025-07-31 12:33:45 +08:00
parent 57c29c8959
commit ca4761f83a

View File

@@ -156,8 +156,6 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
return Err("early skip due to ctrl-c")?; return Err("early skip due to ctrl-c")?;
} }
info!("processing: {user_id}");
let resp = Sdgb1_50::request::<_, GetUserPreviewApiResp>( let resp = Sdgb1_50::request::<_, GetUserPreviewApiResp>(
&client, &client,
APIMethod::GetUserPreviewApi, APIMethod::GetUserPreviewApi,
@@ -170,15 +168,15 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
Ok(resp) => { Ok(resp) => {
use sdgb_api::bincode::encode_to_vec; use sdgb_api::bincode::encode_to_vec;
info!("found: {user_id}");
if let Ok(mut table) = cache::open_table(&write) if let Ok(mut table) = cache::open_table(&write)
&& let Ok(encoded) = encode_to_vec(resp, config) && let Ok(encoded) = encode_to_vec(resp, config)
{ {
_ = table.insert(resp.user_id, encoded); _ = table.insert(resp.user_id, encoded);
} }
} }
Err(sdgb_api::ApiError::JSON { .. }) => { Err(sdgb_api::ApiError::JSON { .. }) => {}
warn!("account unregistered: {user_id}");
}
Err(e) => { Err(e) => {
error!("preview failed: {e}"); error!("preview failed: {e}");
} }