Fix data race with lookup paths
What does this MR do?
Since the API response for domains is cached, it's possible that multiple clients for the same host may cause a data race when sorting the lookup paths. To ensure this doesn't happen, we sort the lookup paths once before we cache it.
Relates to #646 (closed)
See investigation details in https://gitlab.com/gitlab-org/gitlab-pages/-/issues/690#note_1036454543.
TODO
-
I added the Changelog
trailer (e.g.Changelog: added
) to the commits that need to be included in the changelog -
I added unit tests or they are not required -
I added acceptance tests or they are not required -
I added documentation (or it's not required) -
I followed code review guidelines -
I followed Go Style guidelines
Edited by Stan Hu