This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit ce607821e1043fe4e7f442a0e10369248b80c13b Author: Mark Thomas <ma...@apache.org> AuthorDate: Tue Jan 14 07:22:46 2025 +0000 Optimise --- java/org/apache/catalina/webresources/CachedResource.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/java/org/apache/catalina/webresources/CachedResource.java b/java/org/apache/catalina/webresources/CachedResource.java index c71807255d..7a729048dd 100644 --- a/java/org/apache/catalina/webresources/CachedResource.java +++ b/java/org/apache/catalina/webresources/CachedResource.java @@ -101,15 +101,12 @@ public class CachedResource implements WebResource { return false; } - long now = System.currentTimeMillis(); - if (webResource == null) { synchronized (this) { if (webResource == null) { webResource = root.getResourceInternal(webAppPath, useClassLoaderResources); getLastModified(); getContentLength(); - nextCheck = ttl + now; // exists() is a relatively expensive check for a file so // use the fact that we know if it exists at this point if (webResource instanceof EmptyResource) { @@ -122,6 +119,8 @@ public class CachedResource implements WebResource { } } + long now = System.currentTimeMillis(); + if (now < nextCheck) { return true; } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org