mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 09:10:49 +00:00
Tune announcer performance
This commit is contained in:
parent
063c8baaa9
commit
5d6e537ac2
7 changed files with 15 additions and 3 deletions
|
@ -15,6 +15,7 @@ regex = "1"
|
|||
lazy_static = "1"
|
||||
rayon = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
crossbeam-channel = "0.4"
|
||||
|
||||
youmubot-prelude = { path = "../youmubot-prelude" }
|
||||
youmubot-db = { path = "../youmubot-db" }
|
||||
|
|
|
@ -39,6 +39,8 @@ fn update_user(
|
|||
user_id: UserId,
|
||||
cfu: &mut CfUser,
|
||||
) -> CommandResult {
|
||||
// Ensure this takes 200ms
|
||||
let after = crossbeam_channel::after(std::time::Duration::from_secs_f32(0.2));
|
||||
let info = User::info(reqwest, &[cfu.handle.as_str()])?
|
||||
.into_iter()
|
||||
.next()
|
||||
|
@ -91,6 +93,7 @@ fn update_user(
|
|||
}
|
||||
}
|
||||
}
|
||||
after.recv().ok();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue