mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Remove invalid connections from pool
This commit is contained in:
parent
e05a25d701
commit
7f8746fcd4
1 changed files with 11 additions and 3 deletions
|
@ -1607,9 +1607,17 @@ struct HTTPPool
|
|||
end
|
||||
end
|
||||
|
||||
response = yield conn
|
||||
conn.unset_proxy
|
||||
response
|
||||
begin
|
||||
response = yield conn
|
||||
conn.unset_proxy
|
||||
response
|
||||
rescue ex
|
||||
conn = HTTPClient.new(url)
|
||||
conn.family = (url.host == "www.youtube.com") ? CONFIG.force_resolve : Socket::Family::UNSPEC
|
||||
conn.read_timeout = 5.seconds
|
||||
conn.connect_timeout = 5.seconds
|
||||
yield conn
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue