From 004530a0b4de86f249e3047919cd4d87a101d4e5 Mon Sep 17 00:00:00 2001 From: georgehao Date: Tue, 13 Jan 2026 12:02:40 +0800 Subject: [PATCH 1/2] fix postgres bulk insert issue --- bridge-history-api/internal/logic/history_logic.go | 2 +- common/database/db.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bridge-history-api/internal/logic/history_logic.go b/bridge-history-api/internal/logic/history_logic.go index e16f382f37..58edc8ac14 100644 --- a/bridge-history-api/internal/logic/history_logic.go +++ b/bridge-history-api/internal/logic/history_logic.go @@ -372,7 +372,7 @@ func (h *HistoryLogic) getCachedTxsInfo(ctx context.Context, cacheKey string, pa } if start >= total { - return nil, 0, false, nil + return nil, 0, true, nil } values, err := h.redis.ZRevRange(ctx, cacheKey, start, end).Result() diff --git a/common/database/db.go b/common/database/db.go index cd77829ba5..958139d104 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -51,7 +51,8 @@ func InitDB(config *Config) (*gorm.DB, error) { } db, err := gorm.Open(postgres.Open(config.DSN), &gorm.Config{ - Logger: &tmpGormLogger, + CreateBatchSize: 1000, + Logger: &tmpGormLogger, NowFunc: func() time.Time { // why set time to UTC. // if now set this, the inserted data time will use local timezone. like 2023-07-18 18:24:00 CST+8 From eb3bb4ad7cfd5229fda6bbad9268fff903f4b5ac Mon Sep 17 00:00:00 2001 From: georgehao Date: Wed, 14 Jan 2026 08:23:19 +0000 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20auto=20version=20bump=E2=80=89[bot?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/version/version.go b/common/version/version.go index 801661cb3f..9c70d83166 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.7.10" +var tag = "v4.7.11" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok {