Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lz1998 committed Jun 21, 2022
1 parent fe14cd6 commit f390deb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/msg/from_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,23 @@ pub async fn append_image(
contact: Contact,
) -> RCResult<()> {
let url = data.remove("url").unwrap_or_default();
let uin = client.uin().await;
let start = std::time::Instant::now();
let r: u32 = rand::random();
if uin == 2490390725 {
tracing::info!("download_binary {} start", r)
}
let data = get_binary(&url).await?;
tracing::info!("download_binary {} end {:?}", r, start.elapsed());
let start = std::time::Instant::now();
let r: u32 = rand::random();
if uin == 2490390725 {
tracing::info!("upload_image {} start", r)
}
match contact {
Contact::Group(code) => chain.push(client.upload_group_image(code, data).await?),
Contact::Friend(uin) => chain.push(client.upload_friend_image(uin, data).await?),
}
tracing::info!("upload_image {} end {:?}", r, start.elapsed());
Ok(())
}

0 comments on commit f390deb

Please sign in to comment.