An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:fire: 移除冗余代码
Liang Ding5b9f2c3cb117
diff --git a/kernel/conf/backup.go b/kernel/conf/backup.godeleted file mode 100644index 8ccf40c137..0000000000--- a/kernel/conf/backup.go+++ /dev/null@@ -1,34 +0,0 @@-// SiYuan - Build Your Eternal Digital Garden-// Copyright (c) 2020-present, b3log.org-//-// This program is free software: you can redistribute it and/or modify-// it under the terms of the GNU Affero General Public License as published by-// the Free Software Foundation, either version 3 of the License, or-// (at your option) any later version.-//-// This program is distributed in the hope that it will be useful,-// but WITHOUT ANY WARRANTY; without even the implied warranty of-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-// GNU Affero General Public License for more details.-//-// You should have received a copy of the GNU Affero General Public License-// along with this program. If not, see <https://www.gnu.org/licenses/>.--package conf--import (- "path/filepath"-- "github.com/siyuan-note/siyuan/kernel/util"-)--type Backup struct {-}--func NewBackup() *Backup {- return &Backup{}-}--func (b *Backup) GetSaveDir() string {- return filepath.Join(util.WorkspaceDir, "backup")-}diff --git a/kernel/conf/sync.go b/kernel/conf/sync.goindex dd4919814d..ed880d24e0 100644--- a/kernel/conf/sync.go+++ b/kernel/conf/sync.go@@ -16,12 +16,6 @@package conf-import (- "path/filepath"-- "github.com/siyuan-note/siyuan/kernel/util"-)-type Sync struct {CloudName string `json:"cloudName"` // 云端同步目录名称Enabled bool `json:"enabled"` // 是否开启同步@@ -37,7 +31,3 @@ func NewSync() *Sync {Mode: 1,}}--func (s *Sync) GetSaveDir() string {- return filepath.Join(util.WorkspaceDir, "sync")-}diff --git a/kernel/model/conf.go b/kernel/model/conf.goindex 9d624c0b54..a3125c13b4 100644--- a/kernel/model/conf.go+++ b/kernel/model/conf.go@@ -64,7 +64,6 @@ type AppConf struct {AccessAuthCode string `json:"accessAuthCode"` // 访问授权码System *conf.System `json:"system"` // 系统Keymap *conf.Keymap `json:"keymap"` // 快捷键- Backup *conf.Backup `json:"backup"` // 备份配置Sync *conf.Sync `json:"sync"` // 同步配置Search *conf.Search `json:"search"` // 搜索配置Stat *conf.Stat `json:"stat"` // 统计@@ -231,23 +230,9 @@ func InitConf() {Conf.Account = conf.NewAccount()}- if nil == Conf.Backup {- Conf.Backup = conf.NewBackup()- }- if !gulu.File.IsExist(Conf.Backup.GetSaveDir()) {- if err := os.MkdirAll(Conf.Backup.GetSaveDir(), 0755); nil != err {- logging.LogErrorf("create backup dir [%s] failed: %s", Conf.Backup.GetSaveDir(), err)- }- }-if nil == Conf.Sync {Conf.Sync = conf.NewSync()}- if !gulu.File.IsExist(Conf.Sync.GetSaveDir()) {- if err := os.MkdirAll(Conf.Sync.GetSaveDir(), 0755); nil != err {- logging.LogErrorf("create sync dir [%s] failed: %s", Conf.Sync.GetSaveDir(), err)- }- }if 0 == Conf.Sync.Mode {Conf.Sync.Mode = 1}@@ -505,10 +490,10 @@ func InitBoxes() {blockCount := 0if 1 > len(treenode.GetBlockTrees()) {if gulu.File.IsExist(util.BlockTreePath) {- util.IncBootProgress(30, "Reading block trees...")+ util.IncBootProgress(20, "Reading block trees...")go func() {for i := 0; i < 40; i++ {- util.RandomSleep(100, 200)+ util.RandomSleep(50, 100)util.IncBootProgress(1, "Reading block trees...")}}()