Use Travis.config to retrieve default values for api_builds_rate_limit
This commit is contained in:
parent
a37acda0a0
commit
407d2abea1
|
@ -1,8 +1,7 @@
|
|||
module Travis::API::V3
|
||||
class Services::Requests::Create < Service
|
||||
TIME_FRAME = 1.hour
|
||||
LIMIT = 10
|
||||
private_constant :TIME_FRAME, :LIMIT
|
||||
private_constant :TIME_FRAME
|
||||
|
||||
result_type :request
|
||||
params "request", "user", :config, :message, :branch, :token
|
||||
|
@ -24,9 +23,9 @@ module Travis::API::V3
|
|||
|
||||
def limit(repository)
|
||||
if repository.settings.nil?
|
||||
LIMIT
|
||||
Travis.config.requests_create_api_limit
|
||||
else
|
||||
repository.settings["api_builds_rate_limit"] || Travis.config.requests_create_api_limit || LIMIT
|
||||
repository.settings["api_builds_rate_limit"] || Travis.config.requests_create_api_limit
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user