Merge pull request #245 from travis-ci/ar-cd-rate-setting

Use Travis.config to retrieve default values for api_builds_rate_limit
This commit is contained in:
carlad 2016-04-05 17:33:22 +02:00
commit ce1ba54f77
2 changed files with 3 additions and 6 deletions

View File

@ -48,7 +48,7 @@ GIT
GIT
remote: git://github.com/travis-ci/travis-core.git
revision: 9978518236afb520c8fff68bebe7beb62f8ad776
revision: e5740f49f18f826a2d4a246647e5e7f1a26494eb
specs:
travis-core (0.0.1)
actionmailer (~> 3.2.19)
@ -388,6 +388,3 @@ DEPENDENCIES
travis-yaml!
unicorn
yard-sinatra!
BUNDLED WITH
1.12.0.pre.1

View File

@ -1,7 +1,7 @@
module Travis::API::V3
class Services::Requests::Create < Service
TIME_FRAME = 1.hour
LIMIT = 10
LIMIT = 10
private_constant :TIME_FRAME, :LIMIT
result_type :request
@ -24,7 +24,7 @@ module Travis::API::V3
def limit(repository)
if repository.settings.nil?
LIMIT
Travis.config.requests_create_api_limit || LIMIT
else
repository.settings["api_builds_rate_limit"] || Travis.config.requests_create_api_limit || LIMIT
end