traffic_jam 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/scripts/increment.lua +11 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dea90b9ea6d6cdd3f95e0c80541bf26fce1b3690
|
4
|
+
data.tar.gz: 6870c79d37669b7997aea051b45bffe041a176b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79106d2df976e9826ecc5a1b8a7ae3882a1091a79c82f2193f0ea4b9a79bd83b0fa3c35e07e822a77609e25c7b2cb29505c204baae5b5248d5bd24bdc54e669d
|
7
|
+
data.tar.gz: 938bf7f0fcb98d9677015495399078358f50defc35962203f9de833d0cfea646ea0f86a10ac48ef96b6a28f70ba8d486d99f0c84175c662f1f4946d0a4026fc8
|
data/scripts/increment.lua
CHANGED
@@ -17,8 +17,17 @@ else
|
|
17
17
|
local drift_amount = time_diff * arg_max / arg_period
|
18
18
|
if time_diff < 0
|
19
19
|
then
|
20
|
-
local incr_amount
|
21
|
-
|
20
|
+
local incr_amount
|
21
|
+
local incr_magnitude
|
22
|
+
if arg_amount < 0
|
23
|
+
then
|
24
|
+
incr_amount = arg_amount - drift_amount
|
25
|
+
incr_magnitude = -incr_amount
|
26
|
+
else
|
27
|
+
incr_amount = arg_amount + drift_amount
|
28
|
+
incr_magnitude = incr_amount
|
29
|
+
end
|
30
|
+
if incr_magnitude <= 0
|
22
31
|
then
|
23
32
|
return true
|
24
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traffic_jam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Posen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -51,7 +51,7 @@ files:
|
|
51
51
|
- lib/traffic_jam/limit_group.rb
|
52
52
|
- lib/traffic_jam/scripts.rb
|
53
53
|
- scripts/increment.lua
|
54
|
-
homepage:
|
54
|
+
homepage: https://github.com/coinbase/traffic_jam
|
55
55
|
licenses:
|
56
56
|
- MIT
|
57
57
|
metadata: {}
|