prelude: remove ratelimit logs

This commit is contained in:
Natsu Kagami 2020-09-14 22:57:19 -04:00
parent 229e6a911f
commit e46cce3cb6
No known key found for this signature in database
GPG key ID: F17543D4B9424B94
2 changed files with 1 additions and 4 deletions

View file

@ -7,8 +7,8 @@ pub mod announcer;
pub mod args; pub mod args;
pub mod hook; pub mod hook;
pub mod pagination; pub mod pagination;
pub mod setup;
pub mod ratelimit; pub mod ratelimit;
pub mod setup;
pub use announcer::{Announcer, AnnouncerHandler}; pub use announcer::{Announcer, AnnouncerHandler};
pub use args::{Duration, UsernameArg}; pub use args::{Duration, UsernameArg};

View file

@ -40,7 +40,6 @@ impl<T> Ratelimit<T> {
/// The clock counts from the moment the ref is dropped. /// The clock counts from the moment the ref is dropped.
pub async fn borrow<'a>(&'a self) -> Result<impl Deref<Target = T> + 'a> { pub async fn borrow<'a>(&'a self) -> Result<impl Deref<Target = T> + 'a> {
self.recv.recv_async().await?; self.recv.recv_async().await?;
eprintln!("lock accquired! {} left", self.recv.len());
Ok(RatelimitGuard { Ok(RatelimitGuard {
inner: &self.inner, inner: &self.inner,
send: &self.send, send: &self.send,
@ -62,9 +61,7 @@ impl<'a, T> Drop for RatelimitGuard<'a, T> {
let wait_time = self.wait_time.clone(); let wait_time = self.wait_time.clone();
tokio::spawn(async move { tokio::spawn(async move {
tokio::time::delay_for(wait_time).await; tokio::time::delay_for(wait_time).await;
eprintln!("lock lifting!");
send.send_async(()).await.ok(); send.send_async(()).await.ok();
eprintln!("lock lifted!");
}); });
} }
} }