Merge branch 'pr-yuhan0501-4.3.6_bugfix' into 4.3.7_v2

This commit is contained in:
tjq 2024-02-08 15:04:11 +08:00
commit 88f7a06596

View File

@ -141,6 +141,7 @@ public class MySqlSeriesDfsService extends AbstractDFsService {
Map<String, Object> meta = Maps.newHashMap();
meta.put("_server_", NetUtils.getLocalHost());
meta.put("_local_file_path_", storeRequest.getLocalFile().getAbsolutePath());
BufferedInputStream bufferedInputStream = new BufferedInputStream(Files.newInputStream(storeRequest.getLocalFile().toPath()));
Date date = new Date(System.currentTimeMillis());
@ -153,7 +154,7 @@ public class MySqlSeriesDfsService extends AbstractDFsService {
pst.setString(4, JsonUtils.toJSONString(meta));
pst.setLong(5, storeRequest.getLocalFile().length());
pst.setInt(6, SwitchableStatus.ENABLE.getV());
pst.setBlob(7, new BufferedInputStream(Files.newInputStream(storeRequest.getLocalFile().toPath())));
pst.setBlob(7, bufferedInputStream);
pst.setString(8, null);
pst.setDate(9, date);
pst.setDate(10, date);
@ -165,6 +166,8 @@ public class MySqlSeriesDfsService extends AbstractDFsService {
} catch (Exception e) {
log.error("[MySqlSeriesDfsService] store [{}] failed!", fileLocation);
ExceptionUtils.rethrow(e);
}finally {
bufferedInputStream.close();
}
}