refactor(性能测试): 性能测试下载zip使用流下载,兼容1.20升级上来的数据

This commit is contained in:
CaptainB 2024-01-23 13:41:14 +08:00
parent e5e612c8c0
commit f43a61f996
1 changed files with 4 additions and 0 deletions

View File

@ -192,6 +192,10 @@ public class EngineFactory {
if (CollectionUtils.isNotEmpty(resourceFiles)) { if (CollectionUtils.isNotEmpty(resourceFiles)) {
resourceFiles.forEach(cf -> { resourceFiles.forEach(cf -> {
InputStream in = fileMetadataService.getFileAsStream(cf.getId()); InputStream in = fileMetadataService.getFileAsStream(cf.getId());
if (in == null) {
byte[] bytes = fileMetadataService.loadFileAsBytes(cf.getId());
in = new ByteArrayInputStream(bytes);
}
testResourceFiles.put(cf.getName(), in); testResourceFiles.put(cf.getName(), in);
}); });
} }