diff --git a/src/invidious/connection/pool.cr b/src/invidious/connection/pool.cr index 3841636c..565c168d 100644 --- a/src/invidious/connection/pool.cr +++ b/src/invidious/connection/pool.cr @@ -33,9 +33,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