Skip to content

Commit a8815e4

Browse files
travis-architectAndriiMyskoStanislav Kolotinskiy
authored
Bug fix cycle 7 (#1231)
* Increase billing executions endpoint timeout * Set timeout for executions to 60 seconds Co-authored-by: Andrii Mysko <[email protected]> Co-authored-by: Stanislav Kolotinskiy <[email protected]>
1 parent ef2d7ae commit a8815e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/travis/api/v3/billing_client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ class BillingClient
33
class ConfigurationError < StandardError; end
44

55
ALLOWANCE_TIMEOUT = 1 # second
6+
EXECUTIONS_TIMEOUT = 60 # seconds
67

78
def initialize(user_id)
89
@user_id = user_id
@@ -35,7 +36,7 @@ def self.minimal_allowance_response(id = 0)
3536
end
3637

3738
def executions(owner_type, owner_id, page, per_page, from, to)
38-
response = connection.get("/usage/#{owner_type.downcase}s/#{owner_id}/executions?page=#{page}&per_page=#{per_page}&from=#{from}&to=#{to}")
39+
response = connection(timeout: EXECUTIONS_TIMEOUT).get("/usage/#{owner_type.downcase}s/#{owner_id}/executions?page=#{page}&per_page=#{per_page}&from=#{from}&to=#{to}")
3940
executions = response.body.map do |execution_data|
4041
Travis::API::V3::Models::Execution.new(execution_data)
4142
end

0 commit comments

Comments
 (0)