mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-19 23:06:09 +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
|
|
@ -125,8 +125,6 @@ func ExportDataInFolder(exportFolder string) (err error) {
|
|||
defer util.ClearPushProgress(100)
|
||||
|
||||
WaitForWritingFiles()
|
||||
writingDataLock.Lock()
|
||||
defer writingDataLock.Unlock()
|
||||
|
||||
exportFolder = filepath.Join(exportFolder, util.CurrentTimeSecondsStr())
|
||||
err = exportData(exportFolder)
|
||||
|
|
@ -141,8 +139,6 @@ func ExportData() (zipPath string) {
|
|||
defer util.ClearPushProgress(100)
|
||||
|
||||
WaitForWritingFiles()
|
||||
writingDataLock.Lock()
|
||||
defer writingDataLock.Unlock()
|
||||
|
||||
baseFolderName := "data-" + util.CurrentTimeSecondsStr()
|
||||
exportFolder := filepath.Join(util.TempDir, "export", baseFolderName)
|
||||
|
|
@ -162,6 +158,9 @@ func exportData(exportFolder string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
util.WritingFileLock.Lock()
|
||||
defer util.WritingFileLock.Unlock()
|
||||
|
||||
err = filelock.ReleaseAllFileLocks()
|
||||
if nil != err {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue