Fix postgres execWithRetry

This commit is contained in:
Kseniia Sumarokova 2022-06-22 15:44:50 +02:00 committed by GitHub
parent 41ba0118b5
commit cc16854c04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,7 @@ void Connection::execWithRetry(const std::function<void(pqxx::nontransaction &)>
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;
}
}