From cc16854c04d3d803bcda6354848bbb5c422544a8 Mon Sep 17 00:00:00 2001 From: Kseniia Sumarokova <54203879+kssenii@users.noreply.github.com> Date: Wed, 22 Jun 2022 15:44:50 +0200 Subject: [PATCH] Fix postgres execWithRetry --- src/Core/PostgreSQL/Connection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/PostgreSQL/Connection.cpp b/src/Core/PostgreSQL/Connection.cpp index e526396e1d1..dfdf14d3506 100644 --- a/src/Core/PostgreSQL/Connection.cpp +++ b/src/Core/PostgreSQL/Connection.cpp @@ -30,7 +30,7 @@ void Connection::execWithRetry(const std::function LOG_DEBUG(log, "Cannot execute query due to connection failure, attempt: {}/{}. (Message: {})", try_no, num_tries, e.what()); - if (try_no == num_tries) + if (try_no + 1 == num_tries) throw; } }