Skip to content

Commit 3aa0511

Browse files
committed
fix: summary api add index flag check
1 parent 704b2ae commit 3aa0511

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/service/codebase.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,9 @@ func (l *codebaseService) fillContent(ctx context.Context, nodes []*types.Relati
546546
}
547547

548548
func (l *codebaseService) Summarize(ctx context.Context, req *dto.GetIndexSummaryRequest) (*dto.IndexSummary, error) {
549-
549+
if l.manager.GetCodebaseEnv().Switch == dto.SwitchOff {
550+
return nil, errs.ErrIndexDisabled
551+
}
550552
// 从存储获取数量
551553
summary, err := l.indexer.GetSummary(ctx, req.CodebasePath)
552554
if err != nil {

0 commit comments

Comments
 (0)