From 3fba3e71ef805516ccc12f44dc0e5940240ed95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=ED=98=84?= Date: Fri, 4 Oct 2024 14:24:47 +0900 Subject: [PATCH] =?UTF-8?q?Feat:=20GET=EC=9A=94=EC=B2=AD=20=EC=8B=9C=20Sla?= =?UTF-8?q?ck=20=EB=A9=94=EC=84=B8=EC=A7=80=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ai/app/main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ai/app/main.py b/ai/app/main.py index f8fe00e..7dc432a 100644 --- a/ai/app/main.py +++ b/ai/app/main.py @@ -28,10 +28,8 @@ async def resource_cleaner_middleware(request: Request, call_next): raise exc finally: process_time = time.time() - start_time - send_slack_message(f"처리 시간: {process_time}초") - for obj in gc.get_objects(): - if torch.is_tensor(obj): - del obj + if request.method != "GET": + send_slack_message(f"처리 시간: {process_time}초") gc.collect() torch.cuda.empty_cache() return response