Compare commits

...

1 Commits

Author SHA1 Message Date
georgehao
004530a0b4 fix postgres bulk insert issue 2026-01-13 12:02:40 +08:00
2 changed files with 3 additions and 2 deletions

View File

@@ -372,7 +372,7 @@ func (h *HistoryLogic) getCachedTxsInfo(ctx context.Context, cacheKey string, pa
} }
if start >= total { if start >= total {
return nil, 0, false, nil return nil, 0, true, nil
} }
values, err := h.redis.ZRevRange(ctx, cacheKey, start, end).Result() values, err := h.redis.ZRevRange(ctx, cacheKey, start, end).Result()

View File

@@ -51,6 +51,7 @@ func InitDB(config *Config) (*gorm.DB, error) {
} }
db, err := gorm.Open(postgres.Open(config.DSN), &gorm.Config{ db, err := gorm.Open(postgres.Open(config.DSN), &gorm.Config{
CreateBatchSize: 1000,
Logger: &tmpGormLogger, Logger: &tmpGormLogger,
NowFunc: func() time.Time { NowFunc: func() time.Time {
// why set time to UTC. // why set time to UTC.