fix: 批量5000异常

This commit is contained in:
TsMask
2023-09-23 18:11:03 +08:00
parent b35ac3e50b
commit e34bba442a
2 changed files with 4 additions and 4 deletions

View File

@@ -185,7 +185,7 @@ func (r *RepoUdmSubUser) ClearAndInsert(neID string, subArr []model.UdmSubUser)
}
n := len(subArr)
batchSize := 5000
batchSize := 2000
for i := 0; i < n; i += batchSize {
end := i + batchSize
if end > n {
@@ -225,7 +225,7 @@ func (r *RepoUdmSubUser) Insert(subUser model.UdmSubUser) int64 {
func (r *RepoUdmSubUser) Inserts(subUser []model.UdmSubUser) int64 {
var num int64
n := len(subUser)
batchSize := 5000
batchSize := 2000
for i := 0; i < n; i += batchSize {
end := i + batchSize
if end > n {