Skip to content

Commit

Permalink
fix: stream接口上传小文件,文件内容错误 TencentBlueKing#2835
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoxuwan committed Dec 9, 2024
1 parent f22d686 commit 11cc2e0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ class RouteConfiguration(
}

"/stream".nest{
filter(artifactFileCleanupFilterFunction::filter)
PUT(DEFAULT_MAPPING_URI, fileOperationsHandler::stream)
addMetrics(serverMetrics.uploadingCount)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class ArtifactFileCleanupFilterFunction : CoHandlerFilterFunction {
try {
return next(request)
} finally {
logger.info("start clean up")
cleanup(request)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ class FileOperationService(
size = reactiveArtifactFile.getSize()
)
storageManager.storeBlock(reactiveArtifactFile, blockNode)
if (!reactiveArtifactFile.isInMemory()) {
reactiveArtifactFile.getFile()?.deleteOnExit()
}
offset.addAndGet(blockSize)
true
} else {
Expand Down

0 comments on commit 11cc2e0

Please sign in to comment.