fix: postgres bulk insert issue (#1780)

Co-authored-by: georgehao <georgehao@users.noreply.github.com>
This commit is contained in:
georgehao
2026-01-14 16:39:26 +08:00
committed by GitHub
parent 7de388ef1a
commit efca370e1d
3 changed files with 4 additions and 3 deletions

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