bugfix for journal
This commit is contained in:
parent
582e7dd895
commit
16463a58e2
2 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
group = org.xbib
|
||||
name = net-http
|
||||
version = 3.7.0
|
||||
version = 3.7.1
|
||||
|
||||
org.gradle.warning.mode = ALL
|
||||
|
|
|
@ -60,7 +60,7 @@ public class Journal {
|
|||
writeLock.lock();
|
||||
Path path = journalPath.resolve("success").resolve(stamp + ".request");
|
||||
Files.createDirectories(path.getParent());
|
||||
Files.move(journalPath.resolve(stamp), path);
|
||||
Files.move(journalPath.resolve(stamp + ".log"), path);
|
||||
try (OutputStream outputStream = Files.newOutputStream(journalPath.resolve("success").resolve(stamp + ".response"), StandardOpenOption.CREATE)) {
|
||||
outputStream.write(response.getBytes(StandardCharsets.UTF_8));
|
||||
} finally {
|
||||
|
@ -73,7 +73,7 @@ public class Journal {
|
|||
writeLock.lock();
|
||||
Path path = journalPath.resolve("fail").resolve(stamp + ".request");
|
||||
Files.createDirectories(path.getParent());
|
||||
Files.move(journalPath.resolve(stamp), path);
|
||||
Files.move(journalPath.resolve(stamp + ".log"), path);
|
||||
// save throwable in extra file
|
||||
try (OutputStream outputStream = Files.newOutputStream(journalPath.resolve("fail").resolve(stamp + ".exception"), StandardOpenOption.CREATE)) {
|
||||
outputStream.write(ExceptionFormatter.format(t).getBytes(StandardCharsets.UTF_8));
|
||||
|
|
Loading…
Reference in a new issue