scrobbler-ng-utils 2.0.4 → 2.0.5

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.
@@ -2,10 +2,13 @@ module Scrobbler
2
2
  class Base
3
3
  @@fetch_http_lastcall = 0
4
4
  class << self
5
+
6
+ NUMBER_OF_REQUESTS_PER_SECOND = 3
7
+
5
8
  alias :orig_fetch_http :fetch_http
6
9
  def fetch_http(request_method, paramlist)
7
10
  now = ("%10.6f" % Time.now.to_f).to_f
8
- threshold = now - 1
11
+ threshold = now - (1.0/NUMBER_OF_REQUESTS_PER_SECOND)
9
12
  if (@@fetch_http_lastcall > threshold) then
10
13
  sleep(now - @@fetch_http_lastcall)
11
14
  end
@@ -14,4 +17,4 @@ module Scrobbler
14
17
  end
15
18
  end
16
19
  end
17
- end
20
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrobbler-ng-utils
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 4
10
- version: 2.0.4
9
+ - 5
10
+ version: 2.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Uwe L. Korn
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-25 00:00:00 +02:00
18
+ date: 2010-09-13 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency