{"action":"opened","issue":{"url":"https://api.github.com/repos/bjc/prosody/issues/6","labels_url":"https://api.github.com/repos/bjc/prosody/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/bjc/prosody/issues/6/comments","events_url":"https://api.github.com/repos/bjc/prosody/issues/6/events","html_url":"https://github.com/bjc/prosody/issues/6","id":70151586,"number":6,"title":"throttle.lua floor","user":{"login":"Hypher","id":492393,"avatar_url":"https://avatars.githubusercontent.com/u/492393?v=3","gravatar_id":"","url":"https://api.github.com/users/Hypher","html_url":"https://github.com/Hypher","followers_url":"https://api.github.com/users/Hypher/followers","following_url":"https://api.github.com/users/Hypher/following{/other_user}","gists_url":"https://api.github.com/users/Hypher/gists{/gist_id}","starred_url":"https://api.github.com/users/Hypher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hypher/subscriptions","organizations_url":"https://api.github.com/users/Hypher/orgs","repos_url":"https://api.github.com/users/Hypher/repos","events_url":"https://api.github.com/users/Hypher/events{/privacy}","received_events_url":"https://api.github.com/users/Hypher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-22T14:59:04Z","updated_at":"2015-04-22T14:59:04Z","closed_at":null,"body":"At https://github.com/bjc/prosody/blob/master/util/throttle.lua#L15 the floor is problematic.\r\nAssume you have a rate of 1, if you call :update() more than one per second (through :poll for instance), your balance will never raise!\r\nI didn't find any problems letting balance being a float. So removing the floor fixes the problem I mentioned.\r\n(I use throttle for anti-flood purposes)"}}