@@ -79,15 +79,7 @@ func restore(restoreSrvc *upload.RestoreService, filesToRestore map[string]fileu
7979 pool := make (chan struct {}, threads )
8080 checkPath := make (map [string ]bool , 0 )
8181 pathFiles := make (map [string ]map [string ]bool , 0 )
82- temps , _botKey , iUserID := sendMsg ()
83- var iSendMsg func (string )
8482
85- temp := func (text string ) {
86- temps (text )
87- if _botKey != "" && iUserID != "" {
88- iSendMsg (text )
89- }
90- }
9183 for filePath , fileInfo := range filesToRestore {
9284 wg .Add (1 )
9385 pool <- struct {}{}
@@ -102,7 +94,7 @@ func restore(restoreSrvc *upload.RestoreService, filesToRestore map[string]fileu
10294 paths = paths [:len (paths )- 1 ]
10395 }
10496 if _ , ok := checkPath [paths ]; ! ok {
105- userID , bearerToken := httpLocal .GetMyIDAndBearer (infoPath , thread , block , lang , timeOut , _botKey , _UserID )
97+ userID , bearerToken := httpLocal .GetMyIDAndBearer (infoPath , thread , block , lang , timeOut , botKey , _UserID )
10698 files , _ := restoreSrvc .GetDriveItem (userID , bearerToken , paths )
10799 checkPath [paths ] = true
108100 pathFiles [paths ] = files
@@ -115,17 +107,25 @@ func restore(restoreSrvc *upload.RestoreService, filesToRestore map[string]fileu
115107 defer func () {
116108 <- pool
117109 }()
118- if _ , ok := pathFiles [paths ][fileName ]; ! ok || mode == 0 {
119- tip := "`" + filePath + "`" + loc .print ("startToUpload1" )
110+ temps , _botKey , iUserID := sendMsg ()
111+ var iSendMsg func (string )
112+ tip := "`" + filePath + "`" + loc .print ("startToUpload1" )
113+ if _botKey != "" && iUserID != "" {
114+ iSendMsg = botSend (_botKey , iUserID , tip )
115+ }
116+ temp := func (text string ) {
117+ temps (text )
120118 if _botKey != "" && iUserID != "" {
121- iSendMsg = botSend ( _botKey , iUserID , tip )
119+ iSendMsg ( text )
122120 }
121+ }
122+ if _ , ok := pathFiles [paths ][fileName ]; ! ok || mode == 0 {
123123 temp (tip )
124124 userID , bearerToken := httpLocal .GetMyIDAndBearer (infoPath , thread , block , lang , timeOut , _botKey , _UserID )
125125 username := strings .ReplaceAll (filepath .Base (infoPath ), ".json" , "" )
126126 restoreSrvc .SimpleUploadToOriginalLoc (userID , bearerToken , "replace" , targetFolder , filePath , fileInfo , temp , locText , username )
127127 } else {
128- tip : = filePath + "已存在,自动跳过"
128+ tip = filePath + "已存在,自动跳过"
129129 if _botKey != "" && iUserID != "" {
130130 iSendMsg = botSend (_botKey , iUserID , tip )
131131 }
0 commit comments