This commit is contained in:
Leufolium 2024-09-23 16:22:23 +08:00
parent 3f171d684c
commit e1abf6b18a
1 changed files with 35 additions and 36 deletions

View File

@ -23,7 +23,6 @@ func ImportUserIdMap() {
ctx := context.Background()
for i := 1; i < 100; i++ {
go func(i int) {
fmt.Printf("Importing %dth", i)
pathurl := fmt.Sprintf("/app/data_prep/file/user_id_map%v.txt", i)
infile, err := os.Open(pathurl)
@ -50,6 +49,7 @@ func ImportUserIdMap() {
if err != nil {
fmt.Printf("CreateMappedUserIds err :%v", err)
}
userIdMaps = make([]*dbstruct.UserIdMap, 0)
}
if err == io.EOF {
err := mcli.CreateMappedUserIds(ctx, userIdMaps)
@ -61,7 +61,6 @@ func ImportUserIdMap() {
}
infile.Close()
fmt.Printf("%dth imported", i)
}(i)
}
fmt.Printf("Import into test success")