ratelimit-ruby 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/ratelimit-ruby.rb +3 -3
- data/ratelimit-ruby.gemspec +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbbd5fcf9076e26ffc4bbd198cd5b070de24673b
|
4
|
+
data.tar.gz: 8ad171e1bd61f3f20ae662e9435a377b7c43d339
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61588dfe9eccaa4b832112bcb7f89040622f8ef1b4c9f657536a5a3e89e28be3d6a9ce4fa2ad771306584403cc4f0b8c29fa9662d893e62157fb6792c3907d90
|
7
|
+
data.tar.gz: 3f65eadad07f66009a6ddc70890dc9f2cc4c4886a899a6bf1e01e3524d054b982de987bf5986df3612e7842cce7059a3f43c4bd2e816d611707d315105c0f49e
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.9
|
data/lib/ratelimit-ruby.rb
CHANGED
@@ -83,7 +83,7 @@ module RateLimit
|
|
83
83
|
|
84
84
|
def acquire(group, acquire_amount, allow_partial_response: false)
|
85
85
|
|
86
|
-
expiry_cache_key = "it.ratelim.expiry
|
86
|
+
expiry_cache_key = "it.ratelim.expiry:#{group}"
|
87
87
|
if @use_expiry_cache
|
88
88
|
expiry = @shared_cache.read(expiry_cache_key)
|
89
89
|
if !expiry.nil? && Integer(expiry) > Time.now.utc.to_f * 1000
|
@@ -140,7 +140,7 @@ module RateLimit
|
|
140
140
|
def feature_is_on_for?(feature, lookup_key, attributes: [])
|
141
141
|
@stats.increment("it.ratelim.featureflag.on", tags: ["feature:#{feature}"])
|
142
142
|
|
143
|
-
cache_key = "it.ratelim.ff
|
143
|
+
cache_key = "it.ratelim.ff:#{feature}.#{lookup_key}.#{attributes}"
|
144
144
|
@in_process_cache.fetch(cache_key, expires_in: 60) do
|
145
145
|
next uncached_feature_is_on_for?(feature, lookup_key, attributes) if @shared_cache.class == NoopCache
|
146
146
|
|
@@ -186,7 +186,7 @@ module RateLimit
|
|
186
186
|
end
|
187
187
|
|
188
188
|
def get_all_features
|
189
|
-
@shared_cache.fetch("it.ratelim
|
189
|
+
@shared_cache.fetch("it.ratelim:get_all_features", expires_in: 60) do
|
190
190
|
result = @conn.get "/api/v1/featureflags"
|
191
191
|
@stats.increment("it.ratelim.featureflag.getall.req", tags: ["success:#{result.success?}"])
|
192
192
|
if result.success?
|
data/ratelimit-ruby.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: ratelimit-ruby 0.1.
|
5
|
+
# stub: ratelimit-ruby 0.1.9 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "ratelimit-ruby"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.9"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|