Skip to content

Commit 5ebee41

Browse files
author
jasper
committed
fix(splat): wipe tmp directory after run
1 parent 265303a commit 5ebee41

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lambda_function.py

+6
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,12 @@ def lambda_handler(event: dict, context: dict) -> dict: # noqa
407407
except Exception as e:
408408
logger.error(f"splat|unknown_error|{str(e)}|stacktrace:", exc_info=True)
409409
resp = SplatPDFGenerationFailure(status_code=500, message=str(e)).as_response().as_dict()
410+
finally:
411+
try:
412+
execute(["rm", "-rf", "/tmp/*"]) # noqa
413+
except Exception as e:
414+
logger.error(f"splat|cleanup_error|{str(e)}|stacktrace:", exc_info=True)
415+
410416
return resp
411417

412418

0 commit comments

Comments
 (0)