Skip to content

Commit 1047eac

Browse files
committed
Fix invocation by defaulting ticket limit to 1.
This fixes the bug when no limit is set. The bucket thought all tickets were exhausted and returned rate limits.
1 parent fac94f2 commit 1047eac

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/framework/standard/structures/buckets.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,24 @@ impl Bucket {
7171
}
7272
}
7373

74-
#[derive(Default)]
7574
pub struct BucketBuilder {
7675
pub(crate) delay: Duration,
7776
pub(crate) time_span: Duration,
7877
pub(crate) limit: u32,
7978
pub(crate) check: Option<Check>,
8079
}
8180

81+
impl Default for BucketBuilder {
82+
fn default() -> Self {
83+
Self {
84+
delay: Duration::default(),
85+
time_span: Duration::default(),
86+
limit: 1,
87+
check: None,
88+
}
89+
}
90+
}
91+
8292
impl BucketBuilder {
8393
/// The "break" time between invocations of a command.
8494
///

0 commit comments

Comments
 (0)