diff --git a/kernel/conf/backup.go b/kernel/conf/backup.go deleted file mode 100644 index 8ccf40c13..000000000 --- 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 . - -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.go index dd4919814..ed880d24e 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.go index 9d624c0b5..a3125c13b 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 := 0 if 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...") } }()