Feat: GET요청 시 Slack 메세지 제거

This commit is contained in:
김진현 2024-10-04 14:24:47 +09:00
parent 91fff1fb47
commit 3fba3e71ef

View File

@ -28,10 +28,8 @@ async def resource_cleaner_middleware(request: Request, call_next):
raise exc raise exc
finally: finally:
process_time = time.time() - start_time process_time = time.time() - start_time
send_slack_message(f"처리 시간: {process_time}") if request.method != "GET":
for obj in gc.get_objects(): send_slack_message(f"처리 시간: {process_time}")
if torch.is_tensor(obj):
del obj
gc.collect() gc.collect()
torch.cuda.empty_cache() torch.cuda.empty_cache()
return response return response