Skip to content

Commit

Permalink
test: revert changes to bucket config
Browse files Browse the repository at this point in the history
  • Loading branch information
bchrobot committed Jul 29, 2023
1 parent 5a7fa9f commit 4736869
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ describe('integration test', () => {
const rateLimiter = getLeakyBucketRateLimiter({
redis,
bucketTypes: {
// 6 invocations a second
// Drain at 3 invocations a second
bucket: {
capacity: 6,
drainCount: 3,
drainInterval: 2000,
drainInterval: 1000,
},
},
});

let highestN = 0;

const task: Task = async (payload: any) => {
if (payload.n > highestN) {
highestN = payload.n;
Expand All @@ -51,8 +53,6 @@ describe('integration test', () => {
pollInterval: 20, // need a smaller poll interval
});

let highestN = 0;

// if i add 7 jobs, 6 should be run after 100ms, but the 7th shouldnt be run until after 1.1 seconds
await Promise.all(
[...Array(7)].map((_, n) => {
Expand Down

0 comments on commit 4736869

Please sign in to comment.