From 0d5887c2575f9c1d99f479781bfac6f876c6b622 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 89734d2f..9bb0f5e0 100644 --- a/src/invidious/connection/pool.cr +++ b/src/invidious/connection/pool.cr @@ -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