File tree 2 files changed +3
-1
lines changed
2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change 112
112
113
113
COMPANION_POOL = Invidious ::ConnectionPool ::Pool .new(
114
114
max_capacity: CONFIG .pool_size,
115
+ reinitialize_proxy: false
115
116
) do
116
117
companion = CONFIG .invidious_companion.sample
117
118
next make_client(companion.private_url, use_http_proxy: false )
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ module Invidious::ConnectionPool
8
8
* ,
9
9
max_capacity : Int32 = 5 ,
10
10
timeout : Float64 = 5.0 ,
11
+ @reinitialize_proxy : Bool = true , # Whether or not http-proxy should be reinitialized on checkout
11
12
& client_factory : - > HTTP ::Client
12
13
)
13
14
pool_options = DB ::Pool ::Options .new(
@@ -57,7 +58,7 @@ module Invidious::ConnectionPool
57
58
# This new TCP IO will be a direct connection to the server and will not go
58
59
# through the proxy. As such we'll need to reinitialize the proxy connection
59
60
60
- http_client.proxy = make_configured_http_proxy_client() if CONFIG .http_proxy
61
+ http_client.proxy = make_configured_http_proxy_client() if @reinitialize_proxy && CONFIG .http_proxy
61
62
62
63
response = yield http_client
63
64
rescue ex : DB ::PoolTimeout
You can’t perform that action at this time.
0 commit comments