Skip to content

Commit

Permalink
Fix: S3 log forwarder lambda times out (#5622)
Browse files Browse the repository at this point in the history
  • Loading branch information
achave11-ucsc committed Jun 6, 2024
1 parent e4491a2 commit 484f245
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lambdas/indexer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ def log_forwarder(self, prefix: str):
s3_decorator = self.on_s3_event(bucket=aws.logs_bucket,
events=['s3:ObjectCreated:*'],
prefix=prefix)
error_decorator = self.metric_alarm(metric=LambdaMetric.errors)
error_decorator = self.metric_alarm(metric=LambdaMetric.errors,
threshold=1, # One alarm …
period=24 * 60 * 60) # … per day.
throttle_decorator = self.metric_alarm(metric=LambdaMetric.throttles)
retry_decorator = self.retry(num_retries=0)
retry_decorator = self.retry(num_retries=2)

def decorator(f):
return retry_decorator(throttle_decorator(error_decorator(s3_decorator(f))))
Expand Down

0 comments on commit 484f245

Please sign in to comment.