From 3f171d684cf9877bfd28af09fd36f26d62f4818a Mon Sep 17 00:00:00 2001 From: Leufolium <caeruscaemon@outlook.com> Date: Mon, 23 Sep 2024 15:36:01 +0800 Subject: [PATCH] by Robin at 20240923 --- importfunc/import_user_id_map.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/importfunc/import_user_id_map.go b/importfunc/import_user_id_map.go index f6ce888..863737e 100644 --- a/importfunc/import_user_id_map.go +++ b/importfunc/import_user_id_map.go @@ -22,13 +22,14 @@ func ImportUserIdMap() { } ctx := context.Background() - for i := 0; i < 100; i++ { - pathurl := fmt.Sprintf("/app/data_prep/file/user_id_map%v.txt", i) + 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) if err != nil { fmt.Printf("Open File Err : %v", err) + return } reader := bufio.NewReader(infile) userIdMaps := make([]*dbstruct.UserIdMap, 0)