diff options
author | Anton Tananaev <anton@traccar.org> | 2024-06-13 08:50:10 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2024-06-13 08:50:10 -0700 |
commit | cba42ac760e613b4663311ab3dbe6601f0a16d24 (patch) | |
tree | 763ebad389f86eef49ccfbe01111e5fb3c0a5d00 /src/main | |
parent | c9d9a30375e9e4291b41580cb25719b9f5b9e23b (diff) | |
download | trackermap-server-cba42ac760e613b4663311ab3dbe6601f0a16d24.tar.gz trackermap-server-cba42ac760e613b4663311ab3dbe6601f0a16d24.tar.bz2 trackermap-server-cba42ac760e613b4663311ab3dbe6601f0a16d24.zip |
Fix storage sorting
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/traccar/helper/Log.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/helper/Log.java b/src/main/java/org/traccar/helper/Log.java index 37df6a537..6c6d49550 100644 --- a/src/main/java/org/traccar/helper/Log.java +++ b/src/main/java/org/traccar/helper/Log.java @@ -283,8 +283,8 @@ public final class Log { var stores = new ArrayList<Pair<Long, Long>>(); for (FileStore store : FileSystems.getDefault().getFileStores()) { try { - long totalSpace = store.getTotalSpace(); long usableSpace = store.getUsableSpace(); + long totalSpace = store.getTotalSpace(); if (totalSpace > 1_000_000_000) { stores.add(new Pair<>(usableSpace, totalSpace)); } @@ -292,7 +292,7 @@ public final class Log { } } return stores.stream() - .sorted(Comparator.comparingDouble(o -> 1 - o.getFirst() / (double) o.getSecond())) + .sorted(Comparator.comparingDouble(p -> p.getFirst() / (double) p.getSecond())) .flatMap(p -> Stream.of(p.getFirst(), p.getSecond())) .mapToLong(Long::longValue) .toArray(); |