mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-19 05:28:07 +01:00
🎨 Supports configuring data sync index time-consuming prompts https://github.com/siyuan-note/siyuan/issues/9698
This commit is contained in:
parent
a54dd12533
commit
9dfc35e1ac
3 changed files with 18 additions and 3 deletions
|
|
@ -325,6 +325,15 @@ func InitConf() {
|
|||
if nil == Conf.Repo {
|
||||
Conf.Repo = conf.NewRepo()
|
||||
}
|
||||
if timingEnv := os.Getenv("SIYUAN_SYNC_INDEX_TIMING"); "" != timingEnv {
|
||||
val, err := strconv.Atoi(timingEnv)
|
||||
if nil == err {
|
||||
Conf.Repo.SyncIndexTiming = int64(val)
|
||||
}
|
||||
}
|
||||
if 7000 > Conf.Repo.SyncIndexTiming {
|
||||
Conf.Repo.SyncIndexTiming = 7 * 1000
|
||||
}
|
||||
|
||||
if nil == Conf.Search {
|
||||
Conf.Search = conf.NewSearch()
|
||||
|
|
|
|||
|
|
@ -1485,8 +1485,7 @@ func indexRepoBeforeCloudSync(repo *dejavu.Repo) (beforeIndex, afterIndex *entit
|
|||
util.PushStatusBar(fmt.Sprintf(Conf.Language(148), elapsed.Seconds()))
|
||||
}
|
||||
|
||||
if 7000 < elapsed.Milliseconds() {
|
||||
// If the data repo indexing time is greater than 7s, prompt user to purge the data repo https://github.com/siyuan-note/siyuan/issues/9613
|
||||
if Conf.Repo.SyncIndexTiming < elapsed.Milliseconds() {
|
||||
logging.LogWarnf("index data repo before cloud sync elapsed [%dms]", elapsed.Milliseconds())
|
||||
if !promotedPurgeDataRepo {
|
||||
go func() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue