This commit is contained in:
parent
cbaef38589
commit
e4a1319183
|
@ -33,13 +33,14 @@ func ImportUserIdMap() {
|
|||
if upper >= len(list) {
|
||||
upper = len(list) - 1
|
||||
}
|
||||
go ImportAsList(mcli, ctx, list[lower:upper])
|
||||
go ImportAsList(mcli, ctx, list[lower:upper], i)
|
||||
}
|
||||
|
||||
fmt.Printf("Import into test success")
|
||||
}
|
||||
|
||||
func ImportAsList(mcli *mongo.Mongo, ctx context.Context, list []int64) {
|
||||
func ImportAsList(mcli *mongo.Mongo, ctx context.Context, list []int64, s int) {
|
||||
fmt.Printf("Importing %dth", s)
|
||||
userIdMaps := make([]*dbstruct.UserIdMap, 0)
|
||||
for i := range list {
|
||||
seq := int64(1000000) + int64(i)
|
||||
|
@ -62,4 +63,5 @@ func ImportAsList(mcli *mongo.Mongo, ctx context.Context, list []int64) {
|
|||
fmt.Printf("CreateMappedUserIds err :%v", err)
|
||||
}
|
||||
}
|
||||
fmt.Printf("%dth imported", s)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue