mirror of
https://github.com/iv-org/invidious.git
synced 2025-10-25 16:58:06 +00:00
Add config to set connection pool checkout timeout
This commit is contained in:
@@ -92,14 +92,20 @@ SOFTWARE = {
|
||||
"branch" => "#{CURRENT_BRANCH}",
|
||||
}
|
||||
|
||||
YT_POOL = Invidious::ConnectionPool::Pool.new(YT_URL, max_capacity: CONFIG.pool_size, idle_capacity: CONFIG.idle_pool_size)
|
||||
YT_POOL = Invidious::ConnectionPool::Pool.new(
|
||||
YT_URL,
|
||||
max_capacity: CONFIG.pool_size,
|
||||
idle_capacity: CONFIG.idle_pool_size,
|
||||
timeout: CONFIG.pool_checkout_timeout
|
||||
)
|
||||
|
||||
# Image request pool
|
||||
|
||||
GGPHT_POOL = Invidious::ConnectionPool::Pool.new(
|
||||
URI.parse("https://yt3.ggpht.com"),
|
||||
max_capacity: CONFIG.pool_size,
|
||||
idle_capacity: CONFIG.idle_pool_size
|
||||
idle_capacity: CONFIG.idle_pool_size,
|
||||
timeout: CONFIG.pool_checkout_timeout
|
||||
)
|
||||
|
||||
COMPANION_POOL = Invidious::ConnectionPool::CompanionPool.new(
|
||||
|
||||
@@ -163,6 +163,9 @@ class Config
|
||||
# Idle pool size for HTTP requests to youtube.com and ytimg.com (each domain has a separate pool)
|
||||
property idle_pool_size : Int32? = nil
|
||||
|
||||
# Amount of seconds to wait for a client to be free from the pool before rasing an error
|
||||
property pool_checkout_timeout : Int32 = 5
|
||||
|
||||
# HTTP Proxy configuration
|
||||
property http_proxy : HTTPProxyConfig? = nil
|
||||
|
||||
|
||||
@@ -128,7 +128,8 @@ module Invidious::ConnectionPool
|
||||
pool = Invidious::ConnectionPool::Pool.new(
|
||||
URI.parse("https://#{subdomain}.ytimg.com"),
|
||||
max_capacity: CONFIG.pool_size,
|
||||
idle_capacity: CONFIG.idle_pool_size
|
||||
idle_capacity: CONFIG.idle_pool_size,
|
||||
timeout: CONFIG.pool_checkout_timeout
|
||||
)
|
||||
YTIMG_POOLS[subdomain] = pool
|
||||
|
||||
|
||||
Reference in New Issue
Block a user