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 Oct 27, 2023
1 parent 2481692 commit b96d307
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 @@ -1147,8 +1147,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 b96d307

Please sign in to comment.