Skip to content

Commit 5a6e6d4

Browse files
committed
Merge branch 'main' into feature/CCM-17208_Supplier_api_pact_tests
2 parents e84e383 + 3210487 commit 5a6e6d4

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

infrastructure/terraform/components/dl/module_lambda_mesh_poll.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module "mesh_poll" {
4242
ENVIRONMENT = var.environment
4343
EVENT_PUBLISHER_DLQ_URL = module.sqs_event_publisher_errors.sqs_queue_url
4444
EVENT_PUBLISHER_EVENT_BUS_ARN = aws_cloudwatch_event_bus.main.arn
45-
MAXIMUM_RUNTIME_MILLISECONDS = "240000" # 4 minutes (Lambda has 5 min timeout)
45+
LAMBDA_TIMEOUT_BUFFER_MILLISECONDS = "60000" # 1 minute, to leave time for mesh-download to acknowledge the message before we run again.
4646
POLLING_METRIC_NAME = "mesh-poll-successful-polls"
4747
POLLING_METRIC_NAMESPACE = "dl-mesh-poll"
4848
SSM_MESH_PREFIX = local.ssm_mesh_prefix

lambdas/mesh-poll/mesh_poll/__tests__/test_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def setup_mocks():
1313
Create all mock objects needed for processor testing
1414
"""
1515
config = Mock()
16-
config.maximum_runtime_milliseconds = "500"
16+
config.lambda_timeout_buffer_milliseconds = "500"
1717
config.ssm_prefix = "/dl/test"
1818
config.environment = "development"
1919

lambdas/mesh-poll/mesh_poll/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
_REQUIRED_ENV_VAR_MAP = {
99
"ssm_senders_prefix": "SSM_SENDERS_PREFIX",
1010
"ssm_mesh_prefix": "SSM_MESH_PREFIX",
11-
"maximum_runtime_milliseconds": "MAXIMUM_RUNTIME_MILLISECONDS",
11+
"lambda_timeout_buffer_milliseconds": "LAMBDA_TIMEOUT_BUFFER_MILLISECONDS",
1212
"environment": "ENVIRONMENT",
1313
"event_bus_arn": "EVENT_PUBLISHER_EVENT_BUS_ARN",
1414
"event_publisher_dlq_url": "EVENT_PUBLISHER_DLQ_URL",

lambdas/mesh-poll/mesh_poll/processor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ def __init__(self, **kwargs):
4444

4545
def is_enough_time_to_process_message(self):
4646
"""
47-
Determines whether the lambda should continue to process messages
47+
Determines whether the lambda should continue to process messages.
4848
"""
4949
remaining_time_in_millis = self.__get_remaining_time_in_millis()
5050

51-
return int(self.__config.maximum_runtime_milliseconds) \
51+
return int(self.__config.lambda_timeout_buffer_milliseconds) \
5252
< remaining_time_in_millis
5353

5454
def process_messages(self):

0 commit comments

Comments
 (0)