http-threshold 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd6259ff9cac77fc952d5099d7374634aff25038
4
- data.tar.gz: 5055cd6cac2e8c06a26c91c34dc35d2a397de40b
3
+ metadata.gz: 14aa9147a381e0e25bcc0fa27e673991cc8b7475
4
+ data.tar.gz: 5dec506db8ee6a5c1f3171f91e0d122470039194
5
5
  SHA512:
6
- metadata.gz: 2accd9766182e7f04bc000851fc70107668a63c58f55f639e4ec0322c57da577cdbf20b1d0ea166e1da7b4c84bb4da77fcd0945ee1daecf66f93f80b6acfe414
7
- data.tar.gz: 1aa7bd8035be0e7894eef358716a66c89c25c4d436b6692116b717e785c80dad165d0556c817ffe231244d38baf22a3a839ebbcf393f1ea20990dbdc2879f47c
6
+ metadata.gz: aee02697b3490c952f8eb4d155feef4b481f3234a2cf4599c62d340d8fb3f286624109b595572e4c5f511d43914e4b41542e7ed48ba2ef47cce76e2b25ab34d0
7
+ data.tar.gz: 3f8ed5eec61ac2cf1495311a94a9185ade21bd018a3e6cbc8ff1ad260fd4855b7ed27f3a928e3d7381e56004988da6306433f67a4851856d4c9e0096d0bcc41b
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = "http-threshold"
5
- s.version = "0.0.1"
5
+ s.version = "0.0.2"
6
6
  s.date = "2017-11-15"
7
7
  s.homepage = 'https://github.com/yakjuly/http-threshold'
8
8
  s.summary = "A gem for to control external API rate,Could useful for Shopify, Recurly API etc"
@@ -12,4 +12,4 @@ module HttpThreshold
12
12
  end
13
13
  end
14
14
 
15
- Net::HTTPRequest.include HttpThreshold::RequestHold
15
+ Net::HTTPRequest.prepend HttpThreshold::RequestHold
@@ -23,7 +23,7 @@ module HttpThreshold
23
23
  # similar as method #[]
24
24
  def incr_count
25
25
  begin
26
- result = lock_manager.lock!("lock:#{name}", 2000) do
26
+ result = lock_manager.lock!("lock:#{name}", period) do
27
27
  if reach_limit?
28
28
  false
29
29
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http-threshold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ankun Yu