Skip to content

Commit

Permalink
Merge pull request #359 from jmehnle/patch-1
Browse files Browse the repository at this point in the history
Lambda wrapper - Always flush, even on exceptions
  • Loading branch information
yannmh authored Mar 29, 2019
2 parents d5d5332 + c4d1d85 commit bc33215
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions datadog/threadstats/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ def _close(cls):

def __call__(self, *args, **kw):
_LambdaDecorator._enter()
result = self.func(*args, **kw)
_LambdaDecorator._close()
return result
try:
return self.func(*args, **kw)
finally:
_LambdaDecorator._close()


_lambda_stats = ThreadStats()
Expand Down

0 comments on commit bc33215

Please sign in to comment.