From 39afb3379a3fd3a1e13e0caa042a6e8b958f5bbc Mon Sep 17 00:00:00 2001 From: syeopite Date: Tue, 12 Nov 2024 09:07:18 -0800 Subject: [PATCH] Delete broken clients from the pool explicitly --- src/invidious/connection/pool.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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