From 9b99e8ab7039677b3e63aadd24484bdebec1356e Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Thu, 19 Jan 2023 17:00:49 +0800 Subject: [PATCH] fix(search): allow indexed check (close #3103) --- internal/search/build.go | 2 ++ internal/search/util.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/search/build.go b/internal/search/build.go index 52b6be95..8fd1a01c 100644 --- a/internal/search/build.go +++ b/internal/search/build.go @@ -31,6 +31,8 @@ func BuildIndex(ctx context.Context, indexPaths, ignorePaths []string, maxDepth objCount uint64 = 0 fi model.Obj ) + log.Infof("build index for: %+v", indexPaths) + log.Infof("ignore paths: %+v", ignorePaths) Running.Store(true) Quit = make(chan struct{}, 1) indexMQ := mq.NewInMemoryMQ[ObjWithParent]() diff --git a/internal/search/util.go b/internal/search/util.go index 531be619..e89fae18 100644 --- a/internal/search/util.go +++ b/internal/search/util.go @@ -53,9 +53,10 @@ func updateIgnorePaths() { res, err := base.RestyClient.R().Get(url) if err == nil { allowIndexed = utils.Json.Get(res.Body(), "data", conf.AllowIndexed).ToBool() + v3Visited[addition.Address] = allowIndexed } } - if allowIndexed { + if !allowIndexed { ignorePaths = append(ignorePaths, storage.GetStorage().MountPath) } } else {