Only clear cached_routes if there's a route
This commit is contained in:
parent
1a8a3c5b1d
commit
4bb56d2376
1 changed files with 2 additions and 3 deletions
|
@ -34,10 +34,9 @@ module Kemal
|
|||
|
||||
route = @routes.find(lookup_path)
|
||||
|
||||
if route.found? && @cached_routes.size < CACHED_ROUTES_LIMIT
|
||||
if route.found?
|
||||
@cached_routes.clear if @cached_routes.size == CACHED_ROUTES_LIMIT
|
||||
@cached_routes[lookup_path] = route
|
||||
else
|
||||
@cached_routes.clear
|
||||
end
|
||||
|
||||
route
|
||||
|
|
Loading…
Reference in a new issue