mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 23:32:40 +08:00
🎨 Sync repo
This commit is contained in:
parent
e50b2148db
commit
524fa72f59
@ -132,6 +132,18 @@ func SyncData(boot, exit, byHand bool) {
|
|||||||
syncLock.Lock()
|
syncLock.Lock()
|
||||||
defer syncLock.Unlock()
|
defer syncLock.Unlock()
|
||||||
|
|
||||||
|
// 创建数据快照 https://github.com/siyuan-note/siyuan/issues/5161
|
||||||
|
indexRepoBeforeCloudSync()
|
||||||
|
|
||||||
|
if !boot && !exit && byHand {
|
||||||
|
// 同步数据仓库 https://github.com/siyuan-note/siyuan/issues/5142
|
||||||
|
if syncRepoErr := syncRepo(); nil != syncRepoErr {
|
||||||
|
util.LogErrorf("sync repo failed: %s", syncRepoErr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return // TODO: 测试
|
||||||
|
|
||||||
WaitForWritingFiles()
|
WaitForWritingFiles()
|
||||||
writingDataLock.Lock()
|
writingDataLock.Lock()
|
||||||
var err error
|
var err error
|
||||||
@ -150,18 +162,6 @@ func SyncData(boot, exit, byHand bool) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建数据快照 https://github.com/siyuan-note/siyuan/issues/5161
|
|
||||||
indexRepoBeforeCloudSync()
|
|
||||||
|
|
||||||
if !boot && !exit && byHand {
|
|
||||||
// 同步数据仓库 https://github.com/siyuan-note/siyuan/issues/5142
|
|
||||||
if syncRepoErr := syncRepo(); nil != syncRepoErr {
|
|
||||||
util.LogErrorf("sync repo failed: %s", syncRepoErr)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return // TODO: 测试
|
|
||||||
|
|
||||||
// 获取工作空间数据配置(数据版本)
|
// 获取工作空间数据配置(数据版本)
|
||||||
dataConf, err := getWorkspaceDataConf()
|
dataConf, err := getWorkspaceDataConf()
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
Loading…
Reference in New Issue
Block a user