politics-rewired/graphile-worker-rate-limiter

Wrong key deleted when bucket is empty

RisbergAdam opened this issue · 0 comments

The drain bucket routine is using the LeakyBucketSpecialKeys object instead a member of that object when constructing the key to be deleted when the count in a bucket reaches below zero:

.del(`${bucketTypeName}:${bucketName}:${LeakyBucketSpecialKeys}`)

This causes the bucket count to continuously decreasing way past 0.