Skip to content

Commit

Permalink
This fixes #28
Browse files Browse the repository at this point in the history
  • Loading branch information
tballison committed Jun 1, 2023
1 parent 37af744 commit c532765
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,14 @@ private void updateStatusTable() {

private void updateTotalToProcess(AsyncStatus status) {
TotalCountResult r = status.getTotalCountResult();
String cntString = Long.toString(r.getTotalCount());
long total = r.getTotalCount();
long processed = countProcessed(status);
//if someone is adding files to a directory after the total count
//has been calculated
if (total < processed) {
total = processed;
}
String cntString = Long.toString(total);
if (r.getStatus() == TotalCountResult.STATUS.NOT_COMPLETED) {
cntString += " (so far)";
}
Expand All @@ -184,6 +191,11 @@ private void updatePieChart(AsyncStatus status) {

long totalCount = status.getTotalCountResult().getTotalCount();
long processed = countProcessed(status);
//if someone is adding files to a directory after the total count
//has been calculated
if (totalCount < processed) {
totalCount = processed;
}
long unprocessed = 0;
if (totalCount > processed) {
unprocessed = totalCount - processed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public Integer call() throws Exception {
TotalCountResult.STATUS.COMPLETED && processed > total) {
total = 4 * processed;
}
if (processed > total) {
total = processed;
}
if (total > 0) {
float percentage = ((float) processed / (float) total);
LOGGER.trace("setting {} :: {} / {}", percentage, processed, total);
Expand Down

0 comments on commit c532765

Please sign in to comment.