Did I forget the sort?

This commit is contained in:
Szum123321 2022-08-31 22:32:56 +02:00
parent c22eb7a3b2
commit c7fd6d3f8e

View File

@ -31,7 +31,6 @@ import java.nio.file.Path;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.Objects;
import java.util.stream.BaseStream;
import java.util.stream.Stream;
public class Cleanup {
@ -62,7 +61,8 @@ public class Cleanup {
long n = counts[0], size = counts[1];
var it = RestoreableFile.applyOnFiles(root, null,
e -> log.error("An exception occurred while trying to delete old files!", e), BaseStream::iterator);
e -> log.error("An exception occurred while trying to delete old files!", e),
s -> s.sorted().iterator());
if(Objects.isNull(it)) return deletedFiles;