Skip to content
Permalink
Browse files

0003814: Better handling of low disk space

  • Loading branch information...
erilong committed Dec 6, 2018
1 parent 6aa39c6 commit dbdbb122084eba1ca75a5648314e5bec98ba581c
Showing with 8 additions and 5 deletions.
  1. +8 −5 symmetric-io/src/main/java/org/jumpmind/symmetric/io/stage/StagingManager.java
@@ -159,6 +159,14 @@ public long clean(long ttlInMs) {
* Create a handle that can be written to
*/
public IStagedResource create(Object... path) {
String filePath = buildFilePath(path);
IStagedResource resource = createStagedResource(filePath);
if (resource.exists()) {
resource.delete();
} else {
resource.getFile().getParentFile().mkdirs();
}

if (lowFreeSpaceThresholdMegabytes > 0) {
long freeSpace = 0;
if (path.length == 0) {
@@ -172,11 +180,6 @@ public IStagedResource create(Object... path) {
}
}

String filePath = buildFilePath(path);
IStagedResource resource = createStagedResource(filePath);
if (resource.exists()) {
resource.delete();
}
this.inUse.put(filePath, resource);
this.resourcePaths.add(filePath);
return resource;

0 comments on commit dbdbb12

Please sign in to comment.
You can’t perform that action at this time.