travis-api/lib/travis/sidekiq.rb
Piotr Sarnacki b6b1d12f48 Hardcode database pool size for sidekiq
For some reason pool is set to 1 and I can't find the source of this
setting, so for now, just to fix the immediate problem I'm setting it
manually in sidekiq.rb
2016-03-02 15:17:16 +01:00

30 lines
833 B
Ruby

#$: << './lib'
require 'sidekiq'
require 'travis'
require 'travis/api/workers/build_cancellation'
require 'travis/api/workers/build_restart'
require 'travis/api/workers/job_cancellation'
require 'travis/api/workers/job_restart'
require 'travis/support/amqp'
Travis.config.database[:pool] = 5
Travis::Database.connect
if Travis.config.logs_database
Log.establish_connection 'logs_database'
Log::Part.establish_connection 'logs_database'
end
Travis::Async.enabled = true
Travis::Amqp.config = Travis.config.amqp
Travis::Metrics.setup
Travis::Notification.setup
Sidekiq.configure_server do |config|
config.redis = Travis.config.redis.merge(namespace: Travis.config.sidekiq.namespace)
end
Sidekiq.configure_client do |config|
config.redis = Travis.config.redis.merge(size: 1, namespace: Travis.config.sidekiq.namespace)
end