mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
Merge branch 'pr-yuhan0501-4.3.6_bugfix' into 4.3.7_v2
This commit is contained in:
commit
88f7a06596
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user