Skip to content

Commit

Permalink
Merge pull request #34 from wri/develop
Browse files Browse the repository at this point in the history
update lambda function to trigger update when hadoop process failed
  • Loading branch information
Thomas Maschler authored Feb 27, 2020
2 parents dd632b1 + 2e4a19e commit 3409633
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lambda/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def lambda_handler(event, context):
# "subnet-037b97cff4493e3a1", # GFW subnet zone us-east-1e
"subnet-0360516ee122586ff", # GFW subnet zone us-east-1f
]
if tile_date > lastrun and (status == "FAILED" or status == "COMPLETED"):
if tile_date > lastrun and (
status == "FAILED" or status == "HADOOP FAILED" or status == "COMPLETED"
):

message = None
for subnet_id in subnet_ids:
Expand All @@ -58,7 +60,8 @@ def lambda_handler(event, context):
"statusCode": 200,
"headers": {"Content-Type": "application/json"},
"body": {
"Last Update": tile_date_str,
"Lastest data": tile_date_str,
"Last Update": lastrun.strftime("%Y-%m-%d"),
"Status": status,
"Action": "Glad Pipeline triggered",
"Details": response,
Expand All @@ -76,6 +79,7 @@ def lambda_handler(event, context):
"statusCode": 200,
"headers": {"Content-Type": "application/json"},
"body": {
"Latest data": tile_date_str,
"Last Update": lastrun.strftime("%Y-%m-%d"),
"Status": status,
"Action": "No action taken",
Expand Down

0 comments on commit 3409633

Please sign in to comment.