@@ -337,11 +337,12 @@ func (rs *SyncResourceService) PasteDirFrom(task *pool.Task, fs afero.Fs, srcFil
337
337
fsrc := filepath .Join (src , item .Name )
338
338
fdst := filepath .Join (fdstBase , item .Name )
339
339
340
+ klog .Infof ("~~~Debug log: srcUri=%s, fsrc=%s" , srcUri , fsrc )
340
341
fsrcFileParam := & models.FileParam {
341
342
Owner : srcFileParam .Owner ,
342
343
FileType : srcFileParam .FileType ,
343
344
Extend : srcFileParam .Extend ,
344
- Path : strings .TrimPrefix (fsrc , strings .TrimPrefix (srcUri , "/data" )),
345
+ Path : strings .TrimPrefix ("/sync" + fsrc , strings .TrimPrefix (srcUri , "/data" )),
345
346
}
346
347
klog .Infof ("~~~Debug log: dstUri=%s, fdst=%s" , dstUri , fdst )
347
348
fdstFileParam := & models.FileParam {
@@ -1127,9 +1128,10 @@ func SyncFileToBuffer(task *pool.Task, src, bufferFilePath string, srcFileParam
1127
1128
//}
1128
1129
1129
1130
repoID := srcFileParam .Extend
1130
- prefix , filename := filepath .Split (srcFileParam .Path )
1131
+ prefix , filename := filepath .Split (strings . Trim ( srcFileParam .Path , "/" ) )
1131
1132
1132
- dlUrl := "http://127.0.0.1:80/seahub/lib/" + repoID + "/file/" + common .EscapeURLWithSpace (prefix + filename ) + "/" + "?dl=1"
1133
+ dlUrl := "http://127.0.0.1:80/seahub/lib/" + repoID + "/file/" + prefix + "/" + filename + "/" + "?dl=1"
1134
+ klog .Infof ("~~~Debug log: dlURL=%s" , dlUrl )
1133
1135
1134
1136
request , err := http .NewRequestWithContext (task .Ctx , "GET" , dlUrl , nil )
1135
1137
if err != nil {
@@ -1209,7 +1211,7 @@ func SyncFileToBuffer(task *pool.Task, src, bufferFilePath string, srcFileParam
1209
1211
}
1210
1212
1211
1213
if lastProgress != progress {
1212
- task .Log = append (task .Log , fmt .Sprintf ("downloaded from seafile %d/%d with progress %d" , totalRead , diskSize , progress ))
1214
+ task .Log = append (task .Log , "[" + time . Now (). Format ( "2006-01-02 15:04:05" ) + "]" + fmt .Sprintf ("downloaded from seafile %d/%d with progress %d" , totalRead , diskSize , progress ))
1213
1215
lastProgress = progress
1214
1216
}
1215
1217
task .Progress = mappedProgress
@@ -1321,7 +1323,7 @@ func SyncBufferToFile(task *pool.Task, bufferFilePath, dst string, dstFileParam
1321
1323
}
1322
1324
fileSize := fileInfo .Size ()
1323
1325
1324
- chunkSize := int64 (5 * 1024 * 1024 ) // 5 MB
1326
+ chunkSize := int64 (8 * 1024 * 1024 ) // 8MB
1325
1327
totalChunks := (fileSize + chunkSize - 1 ) / chunkSize
1326
1328
identifier := generateUniqueIdentifier (common .EscapeAndJoin (filename , "/" ))
1327
1329
0 commit comments