This commit is contained in:
Leufolium 2024-09-23 11:26:08 +08:00
parent cbaef38589
commit e4a1319183
1 changed files with 4 additions and 2 deletions

View File

@ -33,13 +33,14 @@ func ImportUserIdMap() {
if upper >= len(list) { if upper >= len(list) {
upper = len(list) - 1 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") 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) userIdMaps := make([]*dbstruct.UserIdMap, 0)
for i := range list { for i := range list {
seq := int64(1000000) + int64(i) 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("CreateMappedUserIds err :%v", err)
} }
} }
fmt.Printf("%dth imported", s)
} }