Skip to content

Commit

Permalink
Only use cache file if the last modified matches exactly
Browse files Browse the repository at this point in the history
  • Loading branch information
Tara Drwenski authored and tdrwenski committed Feb 14, 2024
1 parent 3a515a4 commit 9b66db6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private ThreddsWmsCatalogue acquireCatalogue(NetcdfDataset ncd, String tdsDatase
final CachedWmsCatalogue cachedWmsCatalogue = catalogueCache.getIfPresent(tdsDatasetPath);
final long lastModified = ncd.getLastModified();

if (cachedWmsCatalogue != null && cachedWmsCatalogue.lastModified >= lastModified) {
if (cachedWmsCatalogue != null && cachedWmsCatalogue.lastModified == lastModified) {
// Must update NetcdfDataset to ensure file resources are reacquired, as this has been closed.
// But we don't need to recreate the ThreddsWmsCatalogue as it is up-to-date according to the last modified
cachedWmsCatalogue.wmsCatalogue.setNetcdfDataset(ncd);
Expand Down

0 comments on commit 9b66db6

Please sign in to comment.