From 0e6fc222674e26ce370be8928a016035538f0b41 Mon Sep 17 00:00:00 2001 From: Gyoungmin Kim Date: Mon, 4 Nov 2024 14:56:11 +0900 Subject: [PATCH] feat: add tmp file deleting logic for recap api error case --- .../src/main/java/kr/mafoo/photo/service/RecapService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/RecapService.java b/photo-service/src/main/java/kr/mafoo/photo/service/RecapService.java index 8ea586f..1e22eb3 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/service/RecapService.java +++ b/photo-service/src/main/java/kr/mafoo/photo/service/RecapService.java @@ -67,7 +67,8 @@ public Mono createRecap(String albumId, String requestMemberId, String s .flatMap(recapUploadedPath -> localFileService.deleteSimilarNameFileForPath(tmpPath, recapId) .thenReturn(recapUploadedPath) - ); + ) + .doOnError(e -> localFileService.deleteSimilarNameFileForPath(tmpPath, recapId)); } private Mono generateRecapFrame(String recapId, String memberName, String albumType) {