Skip to content

Commit

Permalink
add case for new file added to cache during clean
Browse files Browse the repository at this point in the history
  • Loading branch information
haileyajohnson committed Sep 26, 2023
1 parent 6dedd94 commit 00dbfb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cdm/core/src/main/java/ucar/nc2/util/DiskCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.google.common.escape.Escaper;
import com.google.common.net.UrlEscapers;
import org.joda.time.DateTime;
import ucar.unidata.util.StringUtil2;
import java.io.*;
import java.util.*;
Expand Down Expand Up @@ -347,7 +348,7 @@ public FileAgeComparator(List<File> fileList) {
}

public int compare(File f1, File f2) {
return lastModified.get(f2).compareTo(lastModified.get(f1));
return lastModified.getOrDefault(f2, DateTime.now().getMillis()).compareTo(lastModified.getOrDefault(f1, DateTime.now().getMillis()));
}
}

Expand Down

0 comments on commit 00dbfb7

Please sign in to comment.