From 08da78a96bc0e46b57d92260d8e8bb3ee3dc898b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E6=9C=A8=E8=A6=81?= Date: Fri, 14 Jul 2023 15:21:36 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=81=99=E3=82=8B=E5=87=A6=E7=90=86=E3=81=8C=E6=8A=9C?= =?UTF-8?q?=E3=81=91=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecs/jskult-webapp/src/services/master_mainte_service.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ecs/jskult-webapp/src/services/master_mainte_service.py b/ecs/jskult-webapp/src/services/master_mainte_service.py index 8d37d182..17a3c4a4 100644 --- a/ecs/jskult-webapp/src/services/master_mainte_service.py +++ b/ecs/jskult-webapp/src/services/master_mainte_service.py @@ -161,6 +161,8 @@ class MasterMainteService(BaseService): bucket_name = environment.MASTER_MAINTENANCE_BUCKET file_key = f'data/{os.path.basename(local_file_path)}' self.s3_client.upload_file(local_file_path, bucket_name, file_key) + # アップロード後、ローカルからは削除する + self.delete_local_file(local_file_path) def generate_download_file_url(self, local_file_path: str) -> str: bucket_name = environment.MASTER_MAINTENANCE_BUCKET @@ -177,3 +179,6 @@ class MasterMainteService(BaseService): else: raise Exception(f'登録テーブルの選択値が不正です: {select_table}') return (table_name, selected_table_msg) + + def delete_local_file(self, local_file_path: str): + os.remove(local_file_path)