maxDuration returns the max search duration allowed for this tenant.
(tenantID string)
| 269 | |
| 270 | // maxDuration returns the max search duration allowed for this tenant. |
| 271 | func (s *asyncSearchSharder) maxDuration(tenantID string) time.Duration { |
| 272 | // check overrides first, if no overrides then grab from our config |
| 273 | maxDuration := s.overrides.MaxSearchDuration(tenantID) |
| 274 | if maxDuration != 0 { |
| 275 | return maxDuration |
| 276 | } |
| 277 | |
| 278 | return s.cfg.MaxDuration |
| 279 | } |
| 280 | |
| 281 | // backendRange returns a new start/end range for the backend based on the config parameter |
| 282 | // query_backend_after. If the returned start == the returned end then backend querying is not necessary. |