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
|
module Travis::API::V3
|
||||||
class Services::Requests::Create < Service
|
class Services::Requests::Create < Service
|
||||||
TIME_FRAME = 1.hour
|
TIME_FRAME = 1.hour
|
||||||
LIMIT = 10
|
private_constant :TIME_FRAME
|
||||||
private_constant :TIME_FRAME, :LIMIT
|
|
||||||
|
|
||||||
result_type :request
|
result_type :request
|
||||||
params "request", "user", :config, :message, :branch, :token
|
params "request", "user", :config, :message, :branch, :token
|
||||||
|
@ -24,9 +23,9 @@ module Travis::API::V3
|
||||||
|
|
||||||
def limit(repository)
|
def limit(repository)
|
||||||
if repository.settings.nil?
|
if repository.settings.nil?
|
||||||
LIMIT
|
Travis.config.requests_create_api_limit
|
||||||
else
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user