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 {
return nil, 0, false, nil
return nil, 0, true, nil
}
values, err := h.redis.ZRevRange(ctx, cacheKey, start, end).Result()

View File

@@ -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