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