Delete broken clients from the pool explicitly

This commit is contained in:
syeopite 2024-11-12 09:07:18 -08:00
parent e3313d3ecd
commit 39afb3379a
No known key found for this signature in database
GPG Key ID: A73C186DA3955A1A

View File

@ -33,9 +33,9 @@ module Invidious::ConnectionPool
response = yield http_client response = yield http_client
return response return response
rescue ex : DB::Error rescue ex
# Prevent broken client from being checked back into the pool # Prevent broken client from being checked back into the pool
http_client.close pool.delete(http_client)
raise ConnectionPool::Error.new(ex.message, cause: ex) raise ConnectionPool::Error.new(ex.message, cause: ex)
end end
rescue ex : DB::PoolTimeout rescue ex : DB::PoolTimeout