rookout 0.1.51 → 0.1.52
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rookout/augs/aug_rate_limiter.rb +3 -1
- data/lib/rookout/commit.rb +1 -1
- data/lib/rookout/config.rb +2 -0
- data/lib/rookout/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8854b65da599e09232b62dadbe87cb092dccd93e2a3153dae13e5aa703fcd4e0
|
4
|
+
data.tar.gz: 8fb0f255e23b6eac93f293632a4230e7b24fa80fcdd49d0288d78582ebd121e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0008b3f484e1967418b7cd8bd9db5b8550658a1eb211b5f1ce6f6e731a9fca6733361fd03413f1904dd2aebea889be20418b5fcde963ffd14d116290e8421cf
|
7
|
+
data.tar.gz: 3d2282c21829a747f961e6063435433aa19e88be46ae3f572c8239355ef6dfda585fd12c8d12c4b401d427d7fd0f9040c744b0c27a673b2d9a87a0ac6705ca56
|
@@ -48,7 +48,9 @@ module Rookout
|
|
48
48
|
if @has_quota
|
49
49
|
now_ns = Utils.time_to_nanoseconds start_time
|
50
50
|
current_window_key, = timestamp_to_window_keys now_ns
|
51
|
-
|
51
|
+
time_used = Utils.time_to_nanoseconds(Time.now) - now_ns
|
52
|
+
time_recorded = time_used > Config.min_rate_limit_value_ns ? time_used : Config.min_rate_limit_value_ns
|
53
|
+
@mutex.synchronize { record_usage current_window_key, time_recorded }
|
52
54
|
end
|
53
55
|
# Reduce active count
|
54
56
|
@mutex.synchronize { @active_count -= 1 }
|
data/lib/rookout/commit.rb
CHANGED
data/lib/rookout/config.rb
CHANGED
@@ -82,11 +82,13 @@ module Rookout
|
|
82
82
|
attr_accessor :global_rate_limit_window_size
|
83
83
|
attr_accessor :global_rate_limit
|
84
84
|
attr_accessor :using_global_rate_limiter
|
85
|
+
attr_accessor :min_rate_limit_value_ns
|
85
86
|
|
86
87
|
Rookout::Config.global_rate_limit_quota = ""
|
87
88
|
Rookout::Config.global_rate_limit_window_size = ""
|
88
89
|
Rookout::Config.global_rate_limit = ""
|
89
90
|
Rookout::Config.using_global_rate_limiter = false
|
91
|
+
Rookout::Config.min_rate_limit_value_ns = 125 * 1000
|
90
92
|
|
91
93
|
def update_config configuration
|
92
94
|
update_var2_config configuration
|
data/lib/rookout/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rookout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.52
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liran Haimovitch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: binding_of_caller
|