slowweb 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,13 +7,16 @@ module Net
7
7
  host = self.address
8
8
  limit = SlowWeb.get_limit(host)
9
9
 
10
- # Wait until the request limit is no longer exceeded
11
- while limit.exceeded?
12
- sleep 1
13
- end
10
+ # Manage this request if it has been limited
11
+ if !limit.nil?
12
+ # Wait until the request limit is no longer exceeded
13
+ while limit.exceeded?
14
+ sleep 1
15
+ end
14
16
 
15
- # Add request to limiter
16
- limit.add_request(request)
17
+ # Add request to limiter
18
+ limit.add_request(request)
19
+ end
17
20
 
18
21
  # Continue with the original request
19
22
  request_without_slowweb(request, body, &block)
@@ -1,3 +1,3 @@
1
1
  class SlowWeb
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slowweb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ben Johnson