rookout 0.1.25 → 0.1.26
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/rookout/augs/aug_rate_limiter.rb +3 -10
- data/lib/rookout/commit.rb +1 -1
- 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: 71a48ffc9af42b9e823c1bb8511514e95954425a6ff43495b0f90f7defc98f9c
|
4
|
+
data.tar.gz: a525931c98fc3f8d23068f7d774a18c1b33b2edb756a1abea72a07efe8f2bef6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7fac6cf5a613e6dc45c6071d5c6f6e133568911fa1ee6a66e17e50e22c61523dcd0706c1126ea8390320137e44ca832cb78946c4c57c2608fee0b4d590755b2
|
7
|
+
data.tar.gz: baad1dcec8ec04456aeb993825e36b5025d9c901aaf56970709b51801b55e397f25be02e14153a31978433f8127576e02484af4cdfcb4f34229a22463524669a
|
@@ -30,7 +30,6 @@ module Rookout
|
|
30
30
|
@mutex.synchronize do
|
31
31
|
# Clean old windows
|
32
32
|
cleanup now_ns
|
33
|
-
|
34
33
|
# Increase active count
|
35
34
|
@active_count += 1
|
36
35
|
active = true
|
@@ -58,6 +57,8 @@ module Rookout
|
|
58
57
|
|
59
58
|
private
|
60
59
|
|
60
|
+
attr_reader :windows # will be used only in tests using <OBJ>.send(:windows)
|
61
|
+
|
61
62
|
def timestamp_to_window_keys now_ns
|
62
63
|
current_window_key = (now_ns / @window_size) * @window_size
|
63
64
|
prev_window_key = current_window_key - @window_size
|
@@ -90,15 +91,7 @@ module Rookout
|
|
90
91
|
end
|
91
92
|
|
92
93
|
def cleanup now_ns
|
93
|
-
|
94
|
-
return if @mutex.locked?
|
95
|
-
|
96
|
-
@mutex.synchronize do
|
97
|
-
# every 5 windows-times, clear windows older than 10 window-times
|
98
|
-
if @windows.length > 10
|
99
|
-
@windows.reject! { |key, _| key < (now_ns - @window_size * 5) }
|
100
|
-
end
|
101
|
-
end
|
94
|
+
@windows.reject! { |key, _| key < (now_ns - @window_size * 5) } if @windows.length > 10
|
102
95
|
end
|
103
96
|
end
|
104
97
|
end
|
data/lib/rookout/commit.rb
CHANGED
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.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liran Haimovitch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: binding_of_caller
|