Skip to content

Commit

Permalink
Merge pull request #1163 from alphagov/optimise-find-by-path
Browse files Browse the repository at this point in the history
Speed up FindByPath.find 1000x on K8s/RDS environments
  • Loading branch information
aldavidson authored Oct 12, 2023
2 parents 6498f48 + 1b86cf7 commit 8c0c135
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/lib/find_by_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ def find(path)
return exact_match if exact_match

matches = find_route_matches(path)
matches.any? ? best_route_match(matches, path) : nil

if matches.count.positive?
best_route_match(matches, path)
end
end

private
Expand Down

0 comments on commit 8c0c135

Please sign in to comment.