You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/02/21 19:59:31 UTC

svn commit: r510150 - /lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/SiteTreeImpl.java

Author: andreas
Date: Wed Feb 21 10:59:30 2007
New Revision: 510150

URL: http://svn.apache.org/viewvc?view=rev&rev=510150
Log:
Don't reload sitetree if file system version is newer

Modified:
    lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/SiteTreeImpl.java

Modified: lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/SiteTreeImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/SiteTreeImpl.java?view=diff&rev=510150&r1=510149&r2=510150
==============================================================================
--- lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/SiteTreeImpl.java (original)
+++ lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree2/SiteTreeImpl.java Wed Feb 21 10:59:30 2007
@@ -87,11 +87,20 @@
     protected static final String NAMESPACE = "http://apache.org/cocoon/lenya/sitetree/1.0";
 
     private static final boolean DEFAULT_VISIBILITY = true;
+    
+    private boolean loaded = false;
 
     protected synchronized void load() {
+        
+        if (this.loaded) {
+            return;
+        }
+        
         try {
             Node repoNode = getRepositoryNode();
-            if (repoNode.exists() && repoNode.getLastModified() > this.lastModified) {
+            // lastModified check is necessary for clustering, but can cause 404s
+            // because of the 1s file system last modification granularity
+            if (repoNode.exists() /* && repoNode.getLastModified() > this.lastModified */) {
                 long lastModified = repoNode.getLastModified();
                 org.w3c.dom.Document xml = DocumentHelper.readDocument(repoNode.getInputStream());
                 NamespaceHelper helper = new NamespaceHelper(NAMESPACE, "", xml);
@@ -108,6 +117,9 @@
                 reset();
                 this.lastModified = -1;
             }
+            
+            this.loaded = true;
+            
         } catch (Exception e) {
             throw new RuntimeException(e);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org