mirror of
https://github.com/tickstep/aliyunpan.git
synced 2025-01-23 14:32:14 +08:00
handle local file discard error for sync
This commit is contained in:
parent
7978788ccd
commit
a8850e2479
@ -518,6 +518,10 @@ func (f *FileActionTaskManager) doFileDiffRoutine(panFiles PanFileList, localFil
|
||||
err := fileSum.OpenPath()
|
||||
if err != nil {
|
||||
logger.Verbosef("文件不可读, 错误信息: %s, 跳过...\n", err)
|
||||
if localFile.ScanStatus == ScanStatusDiscard {
|
||||
// 文件已被删除,直接删除无用记录
|
||||
f.task.localFileDb.Delete(localFile.Path)
|
||||
}
|
||||
continue
|
||||
}
|
||||
fileSum.Sum(localfile.CHECKSUM_SHA1) // block operation
|
||||
|
@ -24,12 +24,7 @@ func TestStart(t *testing.T) {
|
||||
user.FileDriveId,
|
||||
panClient,
|
||||
"D:\\smb\\feny\\goprojects\\dev\\sync_drive",
|
||||
1,
|
||||
1,
|
||||
int64(256*1024),
|
||||
aliyunpan.DefaultChunkSize,
|
||||
false,
|
||||
0, 0,
|
||||
SyncOption{},
|
||||
)
|
||||
|
||||
manager.Start(nil)
|
||||
|
@ -3,6 +3,7 @@ package syncdrive
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/tickstep/aliyunpan-api/aliyunpan"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
@ -37,3 +38,11 @@ func TestSyncTask(t *testing.T) {
|
||||
time.Sleep(60 * time.Second)
|
||||
task.Stop()
|
||||
}
|
||||
|
||||
func TestSyncLocker(t *testing.T) {
|
||||
locker := &sync.Mutex{}
|
||||
locker.Lock()
|
||||
fmt.Println("lock")
|
||||
//locker.Unlock()
|
||||
defer locker.Unlock()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user