Delete broken clients from the pool explicitly

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

View File

@ -42,9 +42,9 @@ module Invidious::ConnectionPool
response = yield http_client
return response
rescue ex : DB::Error
rescue ex
# 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)
end
rescue ex : DB::PoolTimeout