From ad1970cb54f2df2a66be4154a85971ef218ff882 Mon Sep 17 00:00:00 2001 From: Niccolo' Zanotti Date: Thu, 5 Sep 2024 15:09:54 +0200 Subject: [PATCH] Remove /tmp/ from logs path. --- lambda_function.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lambda_function.py b/lambda_function.py index 49bbf9c..9c5a897 100644 --- a/lambda_function.py +++ b/lambda_function.py @@ -1,6 +1,4 @@ import json - -import botocore from flask import Flask, request from flask_cors import CORS import boto3 @@ -63,7 +61,7 @@ def log_action(name, action): def append_log_to_s3(log_entry): today = datetime.today() LOG_FILE_KEY = f'{today.strftime("%Y-%m-%d")}-logs.csv' - log_file = f'/tmp/{LOG_FILE_KEY}' # Temporary file path + log_file = f'{LOG_FILE_KEY}' # Temporary file path # Attempt to download the existing log file from S3 if it exists try: