mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 10:30:13 +01:00
🎨 细化云端同步锁提升稳定性 https://github.com/siyuan-note/siyuan/issues/5887
This commit is contained in:
parent
7bc8fba466
commit
90f45a420e
15 changed files with 79 additions and 81 deletions
|
|
@ -267,8 +267,8 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||
os.RemoveAll(assets)
|
||||
}
|
||||
|
||||
writingDataLock.Lock()
|
||||
defer writingDataLock.Unlock()
|
||||
util.WritingFileLock.Lock()
|
||||
defer util.WritingFileLock.Unlock()
|
||||
|
||||
filelock.ReleaseAllFileLocks()
|
||||
|
||||
|
|
@ -331,8 +331,8 @@ func ImportData(zipPath string) (err error) {
|
|||
return errors.New("invalid data.zip")
|
||||
}
|
||||
|
||||
writingDataLock.Lock()
|
||||
defer writingDataLock.Unlock()
|
||||
util.WritingFileLock.Lock()
|
||||
defer util.WritingFileLock.Unlock()
|
||||
|
||||
filelock.ReleaseAllFileLocks()
|
||||
tmpDataPath := filepath.Join(unzipPath, dirs[0].Name())
|
||||
|
|
@ -501,8 +501,6 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
})
|
||||
|
||||
reassignIDUpdated(tree)
|
||||
writingDataLock.Lock()
|
||||
defer writingDataLock.Unlock()
|
||||
if err = filesys.WriteTree(tree); nil != err {
|
||||
return io.EOF
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue