@@ -388,20 +388,7 @@ func (l *codebaseService) QueryDefinition(ctx context.Context, req *dto.SearchDe
388388 return nil , errs .ErrIndexDisabled
389389 }
390390
391- if req .StartLine <= 0 {
392- req .StartLine = 1
393- }
394-
395- if req .EndLine <= 0 {
396- req .EndLine = 1
397- }
398- if req .EndLine < req .StartLine {
399- req .EndLine = req .StartLine
400- }
401-
402- if req .EndLine - req .StartLine > maxLineLimit {
403- req .EndLine = req .StartLine + maxLineLimit
404- }
391+
405392 // codebasePath不能为空
406393 if req .CodebasePath == types .EmptyString {
407394 return nil , fmt .Errorf ("missing param: codebasePath" )
@@ -508,7 +495,7 @@ func (l *codebaseService) QueryReference(ctx context.Context, req *dto.SearchRef
508495}
509496
510497const defaultMaxLayer = 10
511- const maxLayerNodeLimit = 50
498+ const maxLayerNodeLimit = 8
512499
513500func (l * codebaseService ) QueryCallGraph (ctx context.Context , req * dto.SearchCallGraphRequest ) (resp * dto.CallGraphData , err error ) {
514501 // 二次校验
@@ -524,16 +511,7 @@ func (l *codebaseService) QueryCallGraph(ctx context.Context, req *dto.SearchCal
524511 if req .MaxLayer <= 0 || req .MaxLayer > defaultMaxLayer {
525512 req .MaxLayer = defaultMaxLayer
526513 }
527- if req .StartLine <= 0 {
528- req .StartLine = 1
529- }
530- if req .EndLine <= 0 || req .EndLine < req .StartLine {
531- // 如果 EndLine 非法(小于等于0 或小于 StartLine),则将 EndLine 设置为 StartLine
532- req .EndLine = req .StartLine
533- }
534- if delta := req .EndLine - req .StartLine ; delta > maxLineLimit {
535- req .EndLine = req .StartLine + maxLineLimit
536- }
514+
537515 // 保证同一时间只有一个查询调用,避免内存过高
538516 l .mu .Lock ()
539517 defer l .mu .Unlock ()
0 commit comments