Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-12-03 19:09:29 +08:00
commit f259ecd3bd
3 changed files with 5 additions and 4 deletions

View file

@ -326,6 +326,7 @@ func setEditor(c *gin.Context) {
model.Conf.Save()
if oldGenerateHistoryInterval != model.Conf.Editor.GenerateHistoryInterval {
model.GenerateFileHistory()
model.ChangeHistoryTick(editor.GenerateHistoryInterval)
}

View file

@ -187,8 +187,8 @@ func SearchDocsByKeyword(keyword string, flashcard bool, excludeIDs []string) (r
}
}
if 0 < len(excludeIDs) {
condition += fmt.Sprintf(" AND root_id NOT IN ('%s')", strings.Join(excludeIDs, "', '"))
for _, excludeID := range excludeIDs {
condition += fmt.Sprintf(" AND path NOT LIKE '%%%s%%' ", excludeID)
}
rootBlocks = sql.QueryRootBlockByCondition(condition, Conf.Search.Limit)

View file

@ -54,11 +54,11 @@ func AutoGenerateFileHistory() {
ChangeHistoryTick(Conf.Editor.GenerateHistoryInterval)
for {
<-historyTicker.C
task.AppendTask(task.HistoryGenerateFile, generateFileHistory)
task.AppendTask(task.HistoryGenerateFile, GenerateFileHistory)
}
}
func generateFileHistory() {
func GenerateFileHistory() {
defer logging.Recover()
if 1 > Conf.Editor.GenerateHistoryInterval {