Skip to content

Commit

Permalink
Merge pull request #257 from dizzzz/develop
Browse files Browse the repository at this point in the history
Improve measuring minFreeDiskSpace code
  • Loading branch information
wolfgangmm committed Jul 1, 2014
2 parents a00b595 + 7aad7e7 commit 5bf630c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/org/exist/storage/BrokerPool.java
Expand Up @@ -1334,14 +1334,15 @@ public boolean isTransactional() {
return !isReadOnly && transactionsEnabled;
}

private static long minFreeSpace = 50 * 1024 * 1024;
private static final long minFreeSpace = 50l * 1024l * 1024l;

public boolean isReadOnly() {
if (dataLock.getFreeSpace() < minFreeSpace) {
LOG.info("Partition have "+(dataLock.getFreeSpace() / (1024 * 1024))+" Mb.");
final long freeSpace = dataLock.getFreeSpace();
if (freeSpace < minFreeSpace) {
LOG.info("Partition have " + (freeSpace / (1024l * 1024l)) + " Mb.");
setReadOnly();
}
}

return isReadOnly;
}

Expand Down

0 comments on commit 5bf630c

Please sign in to comment.