feat: add batchSize to conf (#1120)

This commit is contained in:
Gucheng
2022-09-13 20:31:22 +08:00
committed by GitHub
parent ed959bd8c7
commit 5707e38912
6 changed files with 28 additions and 15 deletions

View File

@ -18,6 +18,7 @@ import (
"fmt"
"strings"
"github.com/casdoor/casdoor/conf"
"github.com/casdoor/casdoor/util"
"github.com/duo-labs/webauthn/webauthn"
"xorm.io/core"
@ -487,7 +488,7 @@ func AddUsers(users []*User) bool {
}
func AddUsersInBatch(users []*User) bool {
batchSize := 1000
batchSize := conf.GetConfigBatchSize()
if len(users) == 0 {
return false