apps: Limit the number of deployments listed when polling.#865
Merged
andrewsomething merged 2 commits intomainfrom Aug 16, 2022
Merged
apps: Limit the number of deployments listed when polling.#865andrewsomething merged 2 commits intomainfrom
andrewsomething merged 2 commits intomainfrom
Conversation
scotchneat
approved these changes
Aug 16, 2022
|
Hi @andrewsomething 👋 we are experiencing 524 errors on we have a lot of deployments in production, mainly autoscaling events. could the provider be refactored to avoid the |
|
a little debugging on our production:
$ time curl -X GET \
> -H "Content-Type: application/json" \
> -H "Authorization: Bearer ${DIGITALOCEAN_TOKEN}" \
> "https://api.digitalocean.com/v2/apps/b7d31d4f-673b-4e9d-b439-a831f24b5035/deployments?per_page=2"
{"meta":{"total":42554},"links":{"pages":{"last":"https://api.digitalocean.com/v2/apps/b7d31d4f-673b-4e9d-b439-a831f24b5035/deployments?page=21277\u0026per_page=2","next":"https://api.digitalocean.com/v2/apps/b7d31d4f-673b-4e9d-b439-a831f24b5035/deployments?page=2\u0026per_page=2"}},"deployments":[{"id":"477748d6-978c-434a-81ae-5852df088c45","spec":{"name":"production","services":[{"name":...
real 0m39.485s
user 0m0.024s
sys 0m0.020s
$ time curl -X GET \
> -H "Content-Type: application/json" \
> -H "Authorization: Bearer ${DIGITALOCEAN_TOKEN}" \
> "https://api.digitalocean.com/v2/apps/b7d31d4f-673b-4e9d-b439-a831f24b5035/deployments?per_page=20&deployment_types=DEPLOY_ON_PUSH"
{"meta":{"total":0}}
real 0m38.998s
user 0m0.023s
sys 0m0.014s
$ time curl -X GET \
> -H "Content-Type: application/json" \
> -H "Authorization: Bearer ${DIGITALOCEAN_TOKEN}" \
> "https://api.digitalocean.com/v2/apps/b7d31d4f-673b-4e9d-b439-a831f24b5035/deployments?per_page=2&deployment_types=MANUAL"
{"meta":{"total":862},"links":{"pages":{"last":"https://api.digitalocean.com/v2/apps/b7d31d4f-673b-4e9d-b439-a831f24b5035/deployments?deployment_types=MANUAL\u0026page=431\u0026per_page=2","next":"https://api.digitalocean.com/v2/apps/b7d31d4f-673b-4e9d-b439-a831f24b5035/deployments?deployment_types=MANUAL\u0026page=2\u0026per_page=2"}},"deployments":[{"id":"d8600cf5-9beb-4ebb-82e6-8cf1034a5ff9","spec":{"name":"production","services":[{"name":...
real 0m39.748s
user 0m0.019s
sys 0m0.019s
$ time curl -X GET \
> -H "Content-Type: application/json" \
> -H "Authorization: Bearer ${DIGITALOCEAN_TOKEN}" \
> "https://api.digitalocean.com/v2/apps/b7d31d4f-673b-4e9d-b439-a831f24b5035/deployments?per_page=20&deployment_types=MANUAL"
error code: 524
real 2m5.467s
user 0m0.028s
sys 0m0.025s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This works around an issue with the App Platform API where the response body can be too large. We are only actually using the first deployment from the list, so we can use the default page size of 20 rather than 200 to prevent this. I've also removed the loop to prevent iterating through all deployments and using up API request quotas we only need the first one.
Fixes: #864