gcra 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gcra/redis_store.rb +3 -3
- data/lib/gcra/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4523f1a5f4d9e01c3363bbfd24a1d50f3933799a3ee8ac2774a82de49687344e
|
4
|
+
data.tar.gz: 963f7aaa9d67b39920bedc148d7b5c89d7acc7ec6a538fef58b7f845804e2f05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b049fed03339f68e9ef24e6c4d715b28a894a990deb3e50d4f9bedc4af621f7440300efe41b519158b982806df9b3495972de367e39ae8c599095a0e42466e8
|
7
|
+
data.tar.gz: 6f65016b71ad0fce7b47e1f5340e04023ba800304404e1d7eb1dcedb6a183e4dfb0550a58a0cf9b326ef5218f06763e6d12b8b11d79055bda19815a669ef867e
|
data/lib/gcra/redis_store.rb
CHANGED
@@ -30,9 +30,9 @@ module GCRA
|
|
30
30
|
# Returns the value of the key or nil, if it isn't in the store.
|
31
31
|
# Also returns the time from the Redis server, with microsecond precision.
|
32
32
|
def get_with_time(key)
|
33
|
-
time_response, value = @redis.pipelined do
|
34
|
-
|
35
|
-
|
33
|
+
time_response, value = @redis.pipelined do |pipeline|
|
34
|
+
pipeline.time # returns tuple (seconds since epoch, microseconds)
|
35
|
+
pipeline.get(@key_prefix + key)
|
36
36
|
end
|
37
37
|
# Convert tuple to nanoseconds
|
38
38
|
time = (time_response[0] * 1_000_000 + time_response[1]) * 1_000
|
data/lib/gcra/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gcra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Frister
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -41,7 +41,7 @@ dependencies:
|
|
41
41
|
version: '3.3'
|
42
42
|
description: GCRA implementation for rate limiting
|
43
43
|
email:
|
44
|
-
- tobias.schoknecht@
|
44
|
+
- tobias.schoknecht@viafintech.com
|
45
45
|
executables: []
|
46
46
|
extensions: []
|
47
47
|
extra_rdoc_files: []
|
@@ -49,7 +49,7 @@ files:
|
|
49
49
|
- lib/gcra/rate_limiter.rb
|
50
50
|
- lib/gcra/redis_store.rb
|
51
51
|
- lib/gcra/version.rb
|
52
|
-
homepage: https://github.com/
|
52
|
+
homepage: https://github.com/viafintech/gcra-ruby
|
53
53
|
licenses:
|
54
54
|
- MIT
|
55
55
|
metadata: {}
|