feat(index): add disable index option for storages (#7730)

This commit is contained in:
Jealous
2024-12-30 22:52:55 +08:00
committed by GitHub
parent 040dc14ee6
commit ed149be84b
3 changed files with 15 additions and 1 deletions

View File

@ -157,6 +157,11 @@ func BuildIndex(ctx context.Context, indexPaths, ignorePaths []string, maxDepth
return filepath.SkipDir
}
}
if storage, _, err := op.GetStorageAndActualPath(indexPath); err == nil {
if storage.GetStorage().DisableIndex {
return filepath.SkipDir
}
}
// ignore root
if indexPath == "/" {
return nil