This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
internal/server: Cache Horizon URL Name and Host for Deploy Bundle #2950
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this commit, when crafting a Deploy bundle, we would include
the applications deployment URL for each deployment in the bundle.
Looking up this hostname requires making an HTTP request to Horizon. The
way this was originally written, we would look up that URL for all
requested deployments. If a user had 80+ deployments in the bolt db,
this request would take quite some time.
Given that each applications deployment vanity name and hostname should
be the same, and only differs by the deployment sequence, we don't need
to get the hostname for each requested deployment. Instead we can grab
it once, and use it for the remaining deployments in the bundle.
Fixes #2304
In my testing, I had around 180 deployments and the request took about 5 seconds to process.
Now with this fix, the same number of deployments only takes ~30-50 ms. For reference, it only
takes about 20 ms to list a single deployment.