Skip to content

Commit

Permalink
Merge pull request #170 from biopredictive/master
Browse files Browse the repository at this point in the history
Fixing the infamous ResourceConflictException
  • Loading branch information
gdelvalle authored Apr 15, 2022
2 parents a5036e6 + 157ec8b commit 1e4c42b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lambda_uploader/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ def upload_existing(self, pkg):
)
LOG.debug("AWS update_function_code response: %s"
% conf_update_resp)

waiter = self._lambda_client.get_waiter('function_updated')
LOG.debug("Waiting for lambda function to be updated")
waiter.wait(FunctionName=self._config.name)

LOG.debug('running update_function_configuration')
response = self._lambda_client.update_function_configuration(
FunctionName=self._config.name,
Expand All @@ -80,6 +85,11 @@ def upload_existing(self, pkg):
version = response.get('Version')
# Publish the version after upload and config update if needed
if self._config.publish:

waiter = self._lambda_client.get_waiter('function_updated')
LOG.debug("Waiting for lambda function to be updated")
waiter.wait(FunctionName=self._config.name)

resp = self._lambda_client.publish_version(
FunctionName=self._config.name,
)
Expand Down

0 comments on commit 1e4c42b

Please sign in to comment.