0
0
Fork 0

Reduce sleep time in request pool spec (#25470)

This commit is contained in:
Matt Jankowski 2023-06-19 07:48:25 -04:00 committed by GitHub
parent cec4f1d506
commit e1c9d52e91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 10 deletions

View file

@ -28,8 +28,9 @@ class RequestPool
end
MAX_IDLE_TIME = 30
WAIT_TIMEOUT = 5
MAX_POOL_SIZE = ENV.fetch('MAX_REQUEST_POOL_SIZE', 512).to_i
REAPER_FREQUENCY = 30
WAIT_TIMEOUT = 5
class Connection
attr_reader :site, :last_used_at, :created_at, :in_use, :dead, :fresh
@ -98,7 +99,7 @@ class RequestPool
def initialize
@pool = ConnectionPool::SharedConnectionPool.new(size: MAX_POOL_SIZE, timeout: WAIT_TIMEOUT) { |site| Connection.new(site) }
@reaper = Reaper.new(self, 30)
@reaper = Reaper.new(self, REAPER_FREQUENCY)
@reaper.run
end