redis-gcra 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9270bb6ad891cabb878ef0f7dc374f1bf3b872cd
4
- data.tar.gz: 70830bbaf79eba417b109b971d6708f94cd52d18
3
+ metadata.gz: e24cc90618628f397f2ceef8e2431ad3636ec59c
4
+ data.tar.gz: fd6315aa24c6e7b4bfd54e8c450bf5a819a0cd66
5
5
  SHA512:
6
- metadata.gz: 9f082ff34c4a09ab68e2262c2b8733250110a86142707bb1ad01b557e008adb1cecf0dcca05eebdc525d166282aaff76fa339f6a3a09d7cf21a391f01eb84dee
7
- data.tar.gz: 78ab41650d4b1bf08808ba8a2b02d594451bdddc3ba81d54f7c9bdde574ae0cfd254c0beeb410a67e7b29118c1930dcb1fc56198260c828e6682891e0d4719a2
6
+ metadata.gz: ef79f8e1d372661b75e326f2681e966738e104f79ad3ed23eb3bfcee56ce3aab9b9bd56c27e06e78cb89bf49e143c2b2e42530478aa3cc3eb500890841947271
7
+ data.tar.gz: acb1bd7728d4382922b938c595987fac6baa70cfe8776c79d39b0999fb6c8cac20ac8cf6484c4c4a74558f75e0a1a7c16f6214517f561539a1eeb5e949294d68
@@ -1,3 +1,3 @@
1
1
  module RedisGCRA
2
- VERSION = "0.4.0".freeze
2
+ VERSION = "0.4.1".freeze
3
3
  end
@@ -49,7 +49,7 @@ else
49
49
  limited = 0
50
50
  reset_after = new_tat - now
51
51
  redis.call("SET", rate_limit_key, new_tat, "EX", math.ceil(reset_after))
52
- remaining = math.floor(diff / emission_interval)
52
+ remaining = math.floor(diff / emission_interval + 0.5) -- poor man's round
53
53
  retry_after = -1
54
54
  end
55
55
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-gcra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pravosud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-08 00:00:00.000000000 Z
11
+ date: 2017-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis