Skip to content

Commit bdaa338

Browse files
authored
CFX sync
CFX sync
2 parents 7db59c2 + 8a14729 commit bdaa338

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sync/evm/evm_sync.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ func (o *TraceOperation) Exec(tx *gorm.DB) error {
9393
for _, log := range o.logArr {
9494
log.TxId = o.txArr[log.TxIndex].ID
9595
}
96-
if err := tx.Create(&o.logArr).Error; err != nil {
96+
batchSize := 1000
97+
if err := tx.CreateInBatches(&o.logArr, batchSize).Error; err != nil {
9798
return errors.Wrap(err, "create logs")
9899
}
99100
}

0 commit comments

Comments
 (0)