From 11cc2e01e8006e359886a1748eed6be134ac0f64 Mon Sep 17 00:00:00 2001 From: yaoxuwan Date: Mon, 9 Dec 2024 16:32:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20stream=E6=8E=A5=E5=8F=A3=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=B0=8F=E6=96=87=E4=BB=B6=EF=BC=8C=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E9=94=99=E8=AF=AF=20#2835?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/tencent/bkrepo/fs/server/config/RouteConfiguration.kt | 1 - .../fs/server/filter/ArtifactFileCleanupFilterFunction.kt | 1 - .../tencent/bkrepo/fs/server/service/FileOperationService.kt | 3 +++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/config/RouteConfiguration.kt b/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/config/RouteConfiguration.kt index 83fcba4d0d..15b50370a6 100644 --- a/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/config/RouteConfiguration.kt +++ b/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/config/RouteConfiguration.kt @@ -112,7 +112,6 @@ class RouteConfiguration( } "/stream".nest{ - filter(artifactFileCleanupFilterFunction::filter) PUT(DEFAULT_MAPPING_URI, fileOperationsHandler::stream) addMetrics(serverMetrics.uploadingCount) } diff --git a/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/filter/ArtifactFileCleanupFilterFunction.kt b/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/filter/ArtifactFileCleanupFilterFunction.kt index 6e2a3bf690..0d117185f2 100644 --- a/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/filter/ArtifactFileCleanupFilterFunction.kt +++ b/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/filter/ArtifactFileCleanupFilterFunction.kt @@ -43,7 +43,6 @@ class ArtifactFileCleanupFilterFunction : CoHandlerFilterFunction { try { return next(request) } finally { - logger.info("start clean up") cleanup(request) } } diff --git a/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/service/FileOperationService.kt b/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/service/FileOperationService.kt index b590d7fd3f..2a239864c5 100644 --- a/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/service/FileOperationService.kt +++ b/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/service/FileOperationService.kt @@ -138,6 +138,9 @@ class FileOperationService( size = reactiveArtifactFile.getSize() ) storageManager.storeBlock(reactiveArtifactFile, blockNode) + if (!reactiveArtifactFile.isInMemory()) { + reactiveArtifactFile.getFile()?.deleteOnExit() + } offset.addAndGet(blockSize) true } else {