Skip to content

Commit

Permalink
Fix invocation by defaulting ticket limit to 1.
Browse files Browse the repository at this point in the history
This fixes the bug when no limit is set.
The bucket thought all tickets were exhausted and returned rate limits.
  • Loading branch information
Lakelezz committed Dec 17, 2020
1 parent b96529e commit eaead53
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/framework/standard/structures/buckets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,24 @@ impl Bucket {
}
}
}

#[derive(Default)]
pub struct BucketBuilder {
pub(crate) delay: i64,
pub(crate) time_span: i64,
pub(crate) limit: i32,
pub(crate) check: Option<Box<Check>>,
}

impl Default for BucketBuilder {
fn default() -> Self {
Self {
delay: 0,
time_span: 0,
limit: 1,
check: None,
}
}
}

impl BucketBuilder {
/// The "break" time between invocations of a command.
///
Expand Down

0 comments on commit eaead53

Please sign in to comment.