feat: optimize index build

This commit is contained in:
Noah Hsu
2022-12-05 15:46:34 +08:00
parent bc6baf1be0
commit bd33c200dc
6 changed files with 215 additions and 57 deletions

View File

@ -21,7 +21,7 @@ func BuildIndex(c *gin.Context) {
common.ErrorResp(c, err, 400)
return
}
if search.Running {
if search.Running.Load() {
common.ErrorStrResp(c, "index is running", 400)
return
}
@ -41,7 +41,7 @@ func BuildIndex(c *gin.Context) {
}
func StopIndex(c *gin.Context) {
if !search.Running {
if !search.Running.Load() {
common.ErrorStrResp(c, "index is not running", 400)
return
}