Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Sync repo

Liang Ding524fa72f59ca
diff --git a/kernel/model/sync.go b/kernel/model/sync.go
index 0b4ce99345..445cf39502 100644
--- a/kernel/model/sync.go
+++ b/kernel/model/sync.go
@@ -132,6 +132,18 @@ func SyncData(boot, exit, byHand bool) {
syncLock.Lock()
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()
writingDataLock.Lock()
var err error
@@ -150,18 +162,6 @@ func SyncData(boot, exit, byHand bool) {
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()
if nil != err {