Skip to content

Commit 1e4c42b

Browse files
authored
Merge pull request #170 from biopredictive/master
Fixing the infamous ResourceConflictException
2 parents a5036e6 + 157ec8b commit 1e4c42b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lambda_uploader/uploader.py

+10
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ def upload_existing(self, pkg):
6161
)
6262
LOG.debug("AWS update_function_code response: %s"
6363
% conf_update_resp)
64+
65+
waiter = self._lambda_client.get_waiter('function_updated')
66+
LOG.debug("Waiting for lambda function to be updated")
67+
waiter.wait(FunctionName=self._config.name)
68+
6469
LOG.debug('running update_function_configuration')
6570
response = self._lambda_client.update_function_configuration(
6671
FunctionName=self._config.name,
@@ -80,6 +85,11 @@ def upload_existing(self, pkg):
8085
version = response.get('Version')
8186
# Publish the version after upload and config update if needed
8287
if self._config.publish:
88+
89+
waiter = self._lambda_client.get_waiter('function_updated')
90+
LOG.debug("Waiting for lambda function to be updated")
91+
waiter.wait(FunctionName=self._config.name)
92+
8393
resp = self._lambda_client.publish_version(
8494
FunctionName=self._config.name,
8595
)

0 commit comments

Comments
 (0)