summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamantaz Fox <coding@samantaz.fr>2024-11-08 23:32:25 +0100
committerSamantaz Fox <coding@samantaz.fr>2024-11-08 23:32:25 +0100
commit09f5485889e5025cad8c24891f40dbe4e0e6a5b0 (patch)
treebbe10e97c14175685ed366188de8bbebbe387a39 /src
parenta760b69cb6af5ef27429d467205319066a5e12eb (diff)
parent711d52d47fcff4cc376551a81fba47dcaeb23e0c (diff)
downloadinvidious-09f5485889e5025cad8c24891f40dbe4e0e6a5b0.tar.gz
invidious-09f5485889e5025cad8c24891f40dbe4e0e6a5b0.tar.bz2
invidious-09f5485889e5025cad8c24891f40dbe4e0e6a5b0.zip
Shards: Update database dependencies (#5034)
No related issue
Diffstat (limited to 'src')
-rw-r--r--src/invidious/yt_backend/connection_pool.cr10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/invidious/yt_backend/connection_pool.cr b/src/invidious/yt_backend/connection_pool.cr
index 7bbccfd5..c4a73aa7 100644
--- a/src/invidious/yt_backend/connection_pool.cr
+++ b/src/invidious/yt_backend/connection_pool.cr
@@ -22,7 +22,6 @@ struct YoutubeConnectionPool
response = yield conn
rescue ex
conn.close
-
conn = make_client(url, force_resolve: true)
response = yield conn
@@ -34,7 +33,14 @@ struct YoutubeConnectionPool
end
private def build_pool
- DB::Pool(HTTP::Client).new(initial_pool_size: 0, max_pool_size: capacity, max_idle_pool_size: capacity, checkout_timeout: timeout) do
+ options = DB::Pool::Options.new(
+ initial_pool_size: 0,
+ max_pool_size: capacity,
+ max_idle_pool_size: capacity,
+ checkout_timeout: timeout
+ )
+
+ DB::Pool(HTTP::Client).new(options) do
next make_client(url, force_resolve: true)
end
end