mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
⚡ 云端数据同步时降低交互阻塞时间 Fix https://github.com/siyuan-note/siyuan/issues/4984
This commit is contained in:
parent
1cdc80e1bd
commit
c88bd514d3
10 changed files with 63 additions and 91 deletions
|
|
@ -145,8 +145,6 @@ func RecoverLocalBackup() (err error) {
|
|||
data, _ = hex.DecodeString(string(data))
|
||||
passwd := string(data)
|
||||
|
||||
syncLock.Lock()
|
||||
defer syncLock.Unlock()
|
||||
CloseWatchAssets()
|
||||
defer WatchAssets()
|
||||
|
||||
|
|
@ -233,7 +231,7 @@ func RecoverLocalBackup() (err error) {
|
|||
|
||||
util.PushEndlessProgress(Conf.Language(62))
|
||||
time.Sleep(2 * time.Second)
|
||||
refreshFileTree()
|
||||
RefreshFileTree()
|
||||
if syncEnabled {
|
||||
func() {
|
||||
time.Sleep(5 * time.Second)
|
||||
|
|
@ -252,8 +250,6 @@ func CreateLocalBackup() (err error) {
|
|||
util.PushEndlessProgress(Conf.Language(22))
|
||||
|
||||
WaitForWritingFiles()
|
||||
syncLock.Lock()
|
||||
defer syncLock.Unlock()
|
||||
|
||||
filesys.ReleaseAllFileLocks()
|
||||
|
||||
|
|
@ -326,9 +322,6 @@ func CreateLocalBackup() (err error) {
|
|||
}
|
||||
|
||||
func DownloadBackup() (err error) {
|
||||
syncLock.Lock()
|
||||
defer syncLock.Unlock()
|
||||
|
||||
// 使用索引文件进行解密验证 https://github.com/siyuan-note/siyuan/issues/3789
|
||||
var tmpFetchedFiles int
|
||||
var tmpTransferSize uint64
|
||||
|
|
@ -367,9 +360,6 @@ func UploadBackup() (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
syncLock.Lock()
|
||||
defer syncLock.Unlock()
|
||||
|
||||
localDirPath := Conf.Backup.GetSaveDir()
|
||||
util.PushEndlessProgress(Conf.Language(61))
|
||||
util.LogInfof("uploading backup...")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue