lib/storage: respect the deadline passed to Storage.SearchMetricNames

This commit is contained in:
Aliaksandr Valialkin 2021-03-22 23:02:37 +02:00
parent 8e2afdf568
commit 3cfb3a3683

View file

@ -870,6 +870,11 @@ func (s *Storage) SearchMetricNames(tfss []*TagFilters, tr TimeRange, maxMetrics
mns := make([]MetricName, 0, len(tsids))
var metricName []byte
for i := range tsids {
if i&paceLimiterSlowIterationsMask == 0 {
if err := checkSearchDeadlineAndPace(deadline); err != nil {
return nil, err
}
}
metricID := tsids[i].MetricID
var err error
metricName, err = idb.searchMetricNameWithCache(metricName[:0], metricID)