{"action":"opened","issue":{"url":"https://api.github.com/repos/eventEmitter/request-rate-limiter/issues/3","repository_url":"https://api.github.com/repos/eventEmitter/request-rate-limiter","labels_url":"https://api.github.com/repos/eventEmitter/request-rate-limiter/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/eventEmitter/request-rate-limiter/issues/3/comments","events_url":"https://api.github.com/repos/eventEmitter/request-rate-limiter/issues/3/events","html_url":"https://github.com/eventEmitter/request-rate-limiter/issues/3","id":181707054,"number":3,"title":"Invalid setup parameter sent to LeakyBucket","user":{"login":"TomBentleyIBM","id":15682660,"avatar_url":"https://avatars.githubusercontent.com/u/15682660?v=3","gravatar_id":"","url":"https://api.github.com/users/TomBentleyIBM","html_url":"https://github.com/TomBentleyIBM","followers_url":"https://api.github.com/users/TomBentleyIBM/followers","following_url":"https://api.github.com/users/TomBentleyIBM/following{/other_user}","gists_url":"https://api.github.com/users/TomBentleyIBM/gists{/gist_id}","starred_url":"https://api.github.com/users/TomBentleyIBM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomBentleyIBM/subscriptions","organizations_url":"https://api.github.com/users/TomBentleyIBM/orgs","repos_url":"https://api.github.com/users/TomBentleyIBM/repos","events_url":"https://api.github.com/users/TomBentleyIBM/events{/privacy}","received_events_url":"https://api.github.com/users/TomBentleyIBM/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-07T16:01:04Z","updated_at":"2016-10-07T16:01:04Z","closed_at":null,"body":"There is a bug in the version of LeakyBucket you are using (fixed in LeakyBucket 2.1.1).  This bug has to do with the `interval` you are passing.  Unfortunately LeakyBucket is not using this as you can see, instead it's looking for `iterval`.\r\n\r\n```\r\n        , init: function(capacity, iterval, maxWaitingTime) {\r\n                \r\n            if (type.object(capacity) && capacity != null) {\r\n                if (type.number(capacity.capacity)) this.capacity = capacity.capacity;\r\n                if (type.number(capacity.iterval)) this.slotSize = capacity.iterval;\r\n                if (type.number(capacity.maxWaitingTime)) this.maxWaitingTime = capacity.maxWaitingTime;\r\n```\r\n\r\nyou are calling it with \r\n\r\n```\r\n            // set up the leaky bucket\r\n            this.bucket = new LeakyBucket({\r\n                  capacity       : this.rate\r\n                , maxWaitingTime : this.maxWaitingTime\r\n                , interval       : this.interval\r\n            });\r\n```\r\n\r\nThe fix could be to upgrade to the new version of LeakyBucket or add a parameter called `iterval : this.interval`."}}
{"actor":{"display_login":"TomBentleyIBM"}}