File tree 5 files changed +7
-22
lines changed
5 files changed +7
-22
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## 3.0.0
4
4
5
- - Rate throttling is on by default.
5
+ - Rate throttling is on by default. ( https://github.com/heroku/platform-api/pull/104 )
6
6
7
7
## 2.3.0
8
8
9
- - Changes are now tracked in the CHANGELOG.md
10
- - Rate throttling is included by default but disabled.
9
+ - Changes are now tracked in the CHANGELOG.md.
10
+ - Rate throttling is included by default but disabled. ( https://github.com/heroku/platform-api/pull/103 )
Original file line number Diff line number Diff line change 9
9
config . module_name = 'PlatformAPI'
10
10
config . schema_filepath = File . join ( File . expand_path ( '../..' , __FILE__ ) , 'schema.json' )
11
11
12
- PlatformAPI . rate_throttle = -> ( &block ) {
13
- @deprecate_on_first ||= begin
14
- message = String . new ( "[Warning] Starting in PlatformAPI version 3+, requests will include rate throttling logic\n " )
15
- message << "to opt-out of this behavior set: `PlatformAPI.rate_throttle = RateThrottleClient::Null.new`\n "
16
- message << "to silence this warning and opt-in to this logic, upgrade to PlatformAPI version 3+"
17
- warn message
18
- true
19
- end
20
- block . call
21
- }
12
+ PlatformAPI . rate_throttle = RateThrottleClient ::ExponentialIncreaseProportionalRemainingDecrease . new
22
13
config . rate_throttle = PlatformAPI . rate_throttle
23
14
config . acceptable_status_codes = [ 429 ]
24
15
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ def self.custom_options(options)
83
83
84
84
# Get the default options.
85
85
def self.default_options
86
- default_headers = {"Accept"=>"application/vnd.heroku+json; version=3", "User-Agent"=>"platform-api/2. 3.0"}
86
+ default_headers = {"Accept"=>"application/vnd.heroku+json; version=3", "User-Agent"=>"platform-api/3.0.0.pre.1 "}
87
87
{
88
88
default_headers: default_headers,
89
89
url: "https://api.heroku.com"
Original file line number Diff line number Diff line change 1
1
module PlatformAPI
2
- VERSION = '2. 3.0.pre.2 '
2
+ VERSION = '3.0.0. pre.1 '
3
3
end
Original file line number Diff line number Diff line change 11
11
@original_rate_throttle = rate_throttle . dup
12
12
13
13
# No junk in test dots
14
- rate_throttle . log = -> ( *_ ) { } if rate_throttle . respond_to? ( "log=" )
14
+ rate_throttle . log = -> ( *_ ) { }
15
15
16
16
# Don't sleep in tests
17
17
def rate_throttle . sleep ( value ) ; end
@@ -24,8 +24,6 @@ def rate_throttle.sleep(value); end
24
24
end
25
25
26
26
it "works even if first request is rate limited" do
27
- skip ( "Default behavior changes in v3+" ) unless Gem ::Version . new ( PlatformAPI ::VERSION ) >= Gem ::Version . new ( "3.0.0.beta" )
28
-
29
27
stub_request ( :get , "https://api.heroku.com/apps" )
30
28
. to_return ( [
31
29
{ status : 429 } ,
@@ -46,10 +44,6 @@ def rate_throttle.sleep(value); end
46
44
] )
47
45
48
46
@retry_count = 0
49
- throttle = RateThrottleClient ::ExponentialIncreaseProportionalRemainingDecrease . new
50
- def throttle . sleep ( var ) ; end
51
-
52
- PlatformAPI . rate_throttle = throttle
53
47
PlatformAPI . rate_throttle . log = -> ( *_ ) { @retry_count += 1 }
54
48
client . app . list
55
49
You can’t perform that action at this time.
0 commit comments