Skip to content

Commit

Permalink
索引切换使用应用切换
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyun8023 committed Aug 22, 2024
1 parent 8d1132d commit d90e890
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/calibre/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,12 @@ func (c Api) updateIndex(c2 *gin.Context) {
c2.JSON(http.StatusOK, gin.H{"code": 500, "error": err2.Error()})
return
}

index := c.client.Index(c.config.Search.Index + "-bak")
index := c.currentIndex()
if c.useIndex == c.config.Search.Index {
index = c.client.Index(c.config.Search.Index)
} else {
index = c.client.Index(c.config.Search.Index + "-bak")
}
_, err := index.DeleteAllDocuments()
if err != nil {
log.Warn(err)
Expand Down

0 comments on commit d90e890

Please sign in to comment.