From b68c7a33b03b9f8bb937aafbb9b3b4b10d5072cf Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 17 Mar 2016 10:57:12 +0100 Subject: [PATCH] Allow to set sidekiq concurrency separately from web workers Unicorn, which we use to serve the API, uses forked workers that need only one connection per instance. Sidekiq on the other hand runs several instances in memory, so it needs a higher concurrency setting. This commit introduces a way to set sidekiq db pool using SIDEKIQ_DB_POOL_SIZE --- lib/travis/sidekiq.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/travis/sidekiq.rb b/lib/travis/sidekiq.rb index ef5aa91c..38b651be 100644 --- a/lib/travis/sidekiq.rb +++ b/lib/travis/sidekiq.rb @@ -7,6 +7,7 @@ require 'travis/api/workers/job_cancellation' require 'travis/api/workers/job_restart' require 'travis/support/amqp' +Travis.config.database[:pool] = ENV['SIDEKIQ_DB_POOL_SIZE'] || 5 Travis::Database.connect if Travis.config.logs_database