Merge branch 'master' into cd-v3
This commit is contained in:
commit
69852d18b3
|
@ -50,7 +50,7 @@ GIT
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/travis-ci/travis-core.git
|
remote: git://github.com/travis-ci/travis-core.git
|
||||||
revision: 5bff6bf138d31754e38b8c148e56ba8ceab39859
|
revision: f7b3a76b3f39c28bb5cf7b9dc24acec13908a11a
|
||||||
specs:
|
specs:
|
||||||
travis-core (0.0.1)
|
travis-core (0.0.1)
|
||||||
actionmailer (~> 3.2.19)
|
actionmailer (~> 3.2.19)
|
||||||
|
@ -331,7 +331,7 @@ GEM
|
||||||
treetop (1.4.15)
|
treetop (1.4.15)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
tzinfo (0.3.46)
|
tzinfo (0.3.47)
|
||||||
unicorn (4.8.3)
|
unicorn (4.8.3)
|
||||||
kgio (~> 2.6)
|
kgio (~> 2.6)
|
||||||
rack
|
rack
|
||||||
|
@ -390,4 +390,4 @@ DEPENDENCIES
|
||||||
yard-sinatra!
|
yard-sinatra!
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.10.6
|
1.11.2
|
||||||
|
|
|
@ -199,8 +199,10 @@ module Travis::Api
|
||||||
Travis::Database.connect
|
Travis::Database.connect
|
||||||
|
|
||||||
if Travis.config.logs_database
|
if Travis.config.logs_database
|
||||||
Log.establish_connection 'logs_database'
|
pool_size = ENV['DATABASE_POOL_SIZE']
|
||||||
Log::Part.establish_connection 'logs_database'
|
Travis.config.logs_database[:pool] = pool_size.to_i if pool_size
|
||||||
|
|
||||||
|
Travis::LogsModel.establish_connection 'logs_database'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ class Rack::Attack
|
||||||
# Ban after: 10 POST requests within 30 seconds
|
# Ban after: 10 POST requests within 30 seconds
|
||||||
blacklist('spamming with POST requests') do |request|
|
blacklist('spamming with POST requests') do |request|
|
||||||
Rack::Attack::Allow2Ban.filter(request.identifier, maxretry: 10, findtime: 30.seconds, bantime: bantime(1.hour)) do
|
Rack::Attack::Allow2Ban.filter(request.identifier, maxretry: 10, findtime: 30.seconds, bantime: bantime(1.hour)) do
|
||||||
request.post? and not POST_WHITELISTED.include? '/auth/github'
|
request.post? and not POST_WHITELISTED.include? request.path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,13 @@ require 'travis/api/workers/job_cancellation'
|
||||||
require 'travis/api/workers/job_restart'
|
require 'travis/api/workers/job_restart'
|
||||||
require 'travis/support/amqp'
|
require 'travis/support/amqp'
|
||||||
|
|
||||||
|
pool_size = ENV['SIDEKIQ_DB_POOL_SIZE'] || 5
|
||||||
|
Travis.config.database[:pool] = pool_size.to_i
|
||||||
|
Travis.config.logs_database[:pool] = pool_size.to_i
|
||||||
Travis::Database.connect
|
Travis::Database.connect
|
||||||
|
|
||||||
if Travis.config.logs_database
|
if Travis.config.logs_database
|
||||||
Log.establish_connection 'logs_database'
|
Travis::LogsModel.establish_connection 'logs_database'
|
||||||
Log::Part.establish_connection 'logs_database'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Travis::Async.enabled = true
|
Travis::Async.enabled = true
|
||||||
|
|
Loading…
Reference in New Issue
Block a user