Skip to content

Commit

Permalink
Merge pull request #3113 from malakaganga/fix_registry
Browse files Browse the repository at this point in the history
Fix registry not honoring cache expiration
  • Loading branch information
malakaganga authored Feb 13, 2024
2 parents 0b5dd61 + a692768 commit 99cab9a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,14 @@ public RegistryEntry getRegistryEntry(String key) {

private long getLastModifiedTimestamp(String filePath, URLConnection urlc) {
Long lastModifiedFromMap = getResourceLastModifiedEntry(filePath);
Long urlLastModified = urlc.getLastModified(); // Get the last modified timestamp from urlc
Long timestamp;
if (lastModifiedFromMap != null) {
if (lastModifiedFromMap != null && lastModifiedFromMap > urlLastModified) {
timestamp = lastModifiedFromMap;
} else {
timestamp = urlc.getLastModified();
timestamp = urlLastModified;
}

Long lastModifiedPropertiesFromMap = getResourceLastModifiedEntry(filePath + ".properties");
if (lastModifiedPropertiesFromMap != null && lastModifiedPropertiesFromMap > timestamp) {
timestamp = lastModifiedPropertiesFromMap;
Expand Down

0 comments on commit 99cab9a

Please sign in to comment.