An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: More details in sync log
Daniel74e8ebeae9e0
diff --git a/kernel/model/repository.go b/kernel/model/repository.goindex f635bb25ea..3ac448ebe0 100644--- a/kernel/model/repository.go+++ b/kernel/model/repository.go@@ -1007,10 +1007,8 @@ func syncRepoDownload() (err error) {Conf.Save()autoSyncErrCount = 0BootSyncSucc = 0- logging.LogInfof("synced data repo download [provider=%d, ufc=%d, dfc=%d, ucc=%d, dcc=%d, ub=%s, db=%s] in [%.2fs]",- Conf.Sync.Provider, trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)), elapsed.Seconds())- processSyncMergeResult(false, true, start, mergeResult)+ processSyncMergeResult(false, true, mergeResult, trafficStat, "d", elapsed)return}@@ -1077,8 +1075,8 @@ func syncRepoUpload() (err error) {Conf.Save()autoSyncErrCount = 0BootSyncSucc = 0- logging.LogInfof("synced data repo upload [provider=%d, ufc=%d, dfc=%d, ucc=%d, dcc=%d, ub=%s, db=%s] in [%.2fs]",- Conf.Sync.Provider, trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)), elapsed.Seconds())++ processSyncMergeResult(false, true, &dejavu.MergeResult{}, trafficStat, "u", elapsed)return}@@ -1246,14 +1244,18 @@ func syncRepo(exit, byHand bool) (dataChanged bool, err error) {Conf.Sync.Stat = msgConf.Save()autoSyncErrCount = 0- logging.LogInfof("synced data repo [kernel=%s, provider=%d, ufc=%d, dfc=%d, ucc=%d, dcc=%d, ub=%s, db=%s] in [%.2fs]",- KernelID, Conf.Sync.Provider, trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)), elapsed.Seconds())- processSyncMergeResult(exit, byHand, start, mergeResult)+ processSyncMergeResult(exit, byHand, mergeResult, trafficStat, "a", elapsed)return}-func processSyncMergeResult(exit, byHand bool, start time.Time, mergeResult *dejavu.MergeResult) {+func processSyncMergeResult(exit, byHand bool, mergeResult *dejavu.MergeResult, trafficStat *dejavu.TrafficStat, mode string, elapsed time.Duration) {+ logging.LogInfof("synced data repo [kernel=%s, provider=%d, mode=%s/%t, ufc=%d, dfc=%d, ucc=%d, dcc=%d, ub=%s, db=%s] in [%.2fs], merge result [conflicts=%d, upserts=%d, removes=%d]",+ KernelID, Conf.Sync.Provider, mode, byHand,+ trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)),+ elapsed.Seconds(),+ len(mergeResult.Conflicts), len(mergeResult.Upserts), len(mergeResult.Removes))+//logSyncMergeResult(mergeResult)if 0 < len(mergeResult.Conflicts) {@@ -1369,7 +1371,6 @@ func processSyncMergeResult(exit, byHand bool, start time.Time, mergeResult *dej}upsertRootIDs, removeRootIDs := incReindex(upserts, removes)- elapsed := time.Since(start)go func() {if util.ContainerAndroid == util.Container || util.ContainerIOS == util.Container {// 移动端不推送差异详情@@ -1405,7 +1406,6 @@ func logSyncMergeResult(mergeResult *dejavu.MergeResult) {return}- logging.LogInfof("sync merge result [conflicts=%d, upserts=%d, removes=%d]", len(mergeResult.Conflicts), len(mergeResult.Upserts), len(mergeResult.Removes))if 0 < len(mergeResult.Conflicts) {logBuilder := bytes.Buffer{}for i, f := range mergeResult.Conflicts {