degica / barcelona

PaaS built on top of AWS
MIT License
52 stars 6 forks source link

Don't call too many DescribeStacks API to check deploy statuses #727

Open k2nr opened 2 years ago

k2nr commented 2 years ago

Before barcelona deploys a new version, it checks statuses of all stacks (for services) https://github.com/degica/barcelona/blob/1b94dbb45e14fdcab662d9ec9165fa6ec7461a12/app/jobs/deploy_runner_job.rb#L46

While it is necessary to check it, calling DescribeStacks for each service is unnecessary because DescribeStacks returns all stacks if StackName is not specified https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStacks.html

We can optimize that line so that barcelona calls DescribeStacks only once per deployment