Skip to content

Commit

Permalink
Merge c4b0677 into 2019fe4
Browse files Browse the repository at this point in the history
  • Loading branch information
sebatyler committed Mar 1, 2020
2 parents 2019fe4 + c4b0677 commit 7c3f960
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,7 @@ to change Zappa's behavior. Use these at your own risk!
"timeout_seconds": 30, // Maximum lifespan for the Lambda function (default 30, max 900.)
"touch": true, // GET the production URL upon initial deployment (default True)
"touch_path": "/", // The endpoint path to GET when checking the initial deployment (default "/")
"touch_try_count": 4, // Requests try count if requests return 504 when checking the initial deployment (default 4)
"use_precompiled_packages": true, // If possible, use C-extension packages which have been pre-compiled for AWS Lambda. Default true.
"vpc_config": { // Optional Virtual Private Cloud (VPC) configuration for Lambda function
"SubnetIds": [ "subnet-12345678" ], // Note: not all availability zones support Lambda!
Expand Down
9 changes: 5 additions & 4 deletions zappa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2718,12 +2718,13 @@ def touch_endpoint(self, endpoint_url):
# ready and requests will return 504 status_code until ready.
# So, if we get a 504 status code, rerun the request up to 4 times or
# until we don't get a 504 error
if req.status_code == 504:
check_status_code = 504
if req.status_code == check_status_code:
i = 0
status_code = 504
while status_code == 504 and i <= 4:
touch_try_count = self.stage_config.get('touch_try_count', 4)

while req.status_code == check_status_code and i <= touch_try_count:
req = requests.get(endpoint_url + touch_path)
status_code = req.status_code
i += 1

if req.status_code >= 500:
Expand Down
4 changes: 3 additions & 1 deletion zappa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,9 @@ def splitpath(path):
with zipfile.ZipFile(cached_wheel_path) as zfile:
zfile.extractall(temp_project_path)

except requests.exceptions.RequestException as e:
print(e)
raise e
except Exception as e:
print(e)
# XXX - What should we do here?
Expand Down Expand Up @@ -2235,7 +2238,6 @@ def stack_outputs(self, name):
except botocore.client.ClientError:
return {}


def get_api_url(self, lambda_name, stage_name):
"""
Given a lambda_name and stage_name, return a valid API URL.
Expand Down

0 comments on commit 7c3f960

Please sign in to comment.