From 9c24aa0e43c0bfa7db33f17c328faa5121a29a90 Mon Sep 17 00:00:00 2001 From: Nikitin Aleksandr Date: Fri, 16 May 2025 10:32:03 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20Ping=5Fe?= =?UTF-8?q?rr()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- postgres_pgx/postgres_pgx.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/postgres_pgx/postgres_pgx.go b/postgres_pgx/postgres_pgx.go index c481293f..8d5dfc3b 100644 --- a/postgres_pgx/postgres_pgx.go +++ b/postgres_pgx/postgres_pgx.go @@ -524,6 +524,9 @@ func Ping_err(ctxMain context.Context) error { ctx, cancelFunc := context.WithTimeout(ctxMain, timeOutSeconds*time.Second) defer cancelFunc() - _, err = GetConnection().Exec(ctx, ";") + mutex_Connect.Lock() + defer mutex_Connect.Unlock() + + _, err = Conn.Exec(ctx, ";") return err }