roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r468442 - in /incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets: CommentServlet.java TrackbackServlet.java
Date Fri, 27 Oct 2006 16:20:24 GMT
Author: agilliland
Date: Fri Oct 27 09:20:24 2006
New Revision: 468442

URL: http://svn.apache.org/viewvc?view=rev&rev=468442
Log:
only invalidate the caches on a saved comment if the comment wasn't being moderated.


Modified:
    incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/CommentServlet.java
    incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/TrackbackServlet.java

Modified: incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/CommentServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/CommentServlet.java?view=diff&rev=468442&r1=468441&r2=468442
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/CommentServlet.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/CommentServlet.java
Fri Oct 27 09:20:24 2006
@@ -301,10 +301,13 @@
                 mgr.saveComment(comment);
                 RollerFactory.getRoller().flush();
                 
-                reindexEntry(entry);
-                
-                // Clear all caches associated with comment
-                CacheManager.invalidate(comment);
+                // only re-index/invalidate the cache if comment isn't moderated
+                if(!weblog.getCommentModerationRequired()) {
+                    reindexEntry(entry);
+                    
+                    // Clear all caches associated with comment
+                    CacheManager.invalidate(comment);
+                }
                 
                 // Send email notifications
                 String rootURL = RollerRuntimeConfig.getAbsoluteContextURL();

Modified: incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/TrackbackServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/TrackbackServlet.java?view=diff&rev=468442&r1=468441&r2=468442
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/TrackbackServlet.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/ui/rendering/servlets/TrackbackServlet.java
Fri Oct 27 09:20:24 2006
@@ -85,6 +85,7 @@
         
         WeblogTrackbackRequest trackbackRequest = null;
         if(!RollerRuntimeConfig.getBooleanProperty("users.trackbacks.enabled")) {
+            // TODO: i18n
             error = "Trackbacks are disabled for this site";
         } else {
             
@@ -122,7 +123,7 @@
                 
             } catch (Exception e) {
                 // some kind of error parsing the request or looking up weblog
-                logger.debug("error creating page request", e);
+                logger.debug("error creating trackback request", e);
                 error = e.getMessage();
             }
         }
@@ -187,8 +188,11 @@
                     mgr.saveComment(comment);
                     RollerFactory.getRoller().flush();
                     
-                    // Clear all caches associated with comment
-                    CacheManager.invalidate(comment);
+                    // only invalidate the cache if comment isn't moderated
+                    if(!weblog.getCommentModerationRequired()) {
+                        // Clear all caches associated with comment
+                        CacheManager.invalidate(comment);
+                    }
                     
                     // Send email notifications
                     String rootURL = RollerRuntimeConfig.getAbsoluteContextURL();



Mime
View raw message