Skip to content

Commit

Permalink
beatlabs#128 check for min < max
Browse files Browse the repository at this point in the history
Signed-off-by: Vangelis Katikaridis <[email protected]>
  • Loading branch information
drakos74 committed May 2, 2020
1 parent 5e6f3b9 commit 4feccb3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions component/http/cache_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ func NewRouteCache(cache cache.Cache, ageBounds Age) *RouteCache {
ee = append(ee, errors.New("max age must be greater than `0`"))
}

if ageBounds.Min > ageBounds.Max {
ee = append(ee, errors.New("max age must always be greater than min age"))
}

return &RouteCache{
cache: cache,
instant: func() int64 {
Expand Down

0 comments on commit 4feccb3

Please sign in to comment.