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 May 24, 2024
1 parent bfc4f70 commit e3c8430
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 = app.metric_alarm(metric=LambdaMetric.errors)
error_decorator = app.metric_alarm(metric=LambdaMetric.errors,
threshold=1, # One alarm …
period=24 * 60 * 60) # … per day.
throttle_decorator = app.metric_alarm(metric=LambdaMetric.throttles)
retry_decorator = app.retry(times=0)
retry_decorator = app.retry(times=2)

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

0 comments on commit e3c8430

Please sign in to comment.