From 02e0c9c31a87d4779955848438620f8654bf053d Mon Sep 17 00:00:00 2001 From: douxu Date: Fri, 30 Jan 2026 17:42:50 +0800 Subject: [PATCH] optimzie of postgres db code --- database/postgres_init.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/database/postgres_init.go b/database/postgres_init.go index bd7869f..fdba0ee 100644 --- a/database/postgres_init.go +++ b/database/postgres_init.go @@ -13,15 +13,11 @@ import ( var ( postgresOnce sync.Once _globalPostgresClient *gorm.DB - _globalPostgresMu sync.RWMutex ) // GetPostgresDBClient returns the global PostgresDB client.It's safe for concurrent use. func GetPostgresDBClient() *gorm.DB { - _globalPostgresMu.RLock() - client := _globalPostgresClient - _globalPostgresMu.RUnlock() - return client + return _globalPostgresClient } // InitPostgresDBInstance return instance of PostgresDB client