Skip to content

Commit

Permalink
Use long Terra timeout in indexer lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
nadove-ucsc committed Nov 7, 2023
1 parent 14c9b4a commit 9daadb3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/azul/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1157,8 +1157,22 @@ def _timing_is_restricted(self) -> bool:
if self.lambda_context is None:
return False
else:
remaining = self.lambda_context.get_remaining_time_in_millis() / 1000
return remaining <= self.api_gateway_lambda_timeout
function_name = self.lambda_context.function_name
try:
app_name, _, _ = self.unqualified_resource_name_and_suffix(function_name)
except RequirementError:
from chalice.constants import (
DEFAULT_HANDLER_NAME,
)
assert function_name == DEFAULT_HANDLER_NAME, function_name
return False
else:
if app_name == 'service':
remaining = self.lambda_context.get_remaining_time_in_millis() / 1000
return remaining <= self.api_gateway_lambda_timeout
else:
assert app_name == 'indexer', (function_name, app_name)
return False

@property
def terra_client_timeout(self) -> float:
Expand Down

0 comments on commit 9daadb3

Please sign in to comment.