Skip to content

Commit

Permalink
fix(carbonserver): find - cache http404 responses to prevent redundan…
Browse files Browse the repository at this point in the history
…t lookups; this also makes logic similar to renderHandler where 404s are cached
  • Loading branch information
Anton Timofieiev committed Feb 11, 2023
1 parent 0fb928d commit c754d58
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions carbonserver/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,7 @@ func (listener *CarbonserverListener) findMetrics(ctx context.Context, logger *z
return nil, err
}

if len(multiResponse.Metrics) == 0 {
return nil, errorNotFound{}
}

return &result, err

case protoV2Format:
result.contentType = httpHeaders.ContentTypeProtobuf
var err error
Expand All @@ -299,12 +294,7 @@ func (listener *CarbonserverListener) findMetrics(ctx context.Context, logger *z
return nil, err
}

if len(response.Matches) == 0 {
return nil, errorNotFound{}
}

return &result, err

case pickleFormat:
// [{'metric_path': 'metric', 'intervals': [(x,y)], 'isLeaf': True},]
var metrics []map[string]interface{}
Expand Down

0 comments on commit c754d58

Please sign in to comment.