summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2009-10-11 20:36:08 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2009-10-11 20:36:08 +0200
commit74b3d8e0377b6e0801650d730ad1813db68b0ef1 (patch)
tree9f1a6f71a740b7e0218bcd4f2a207c79051dea80
parent273acd2a774a9815da5d13c77f69958eabfbbf88 (diff)
Make comment moderation more efficient, only rebuilding the pages that need to be.
Ignore-this: 68b399cb649e554409de199cea9064df darcs-hash:0dca71dc0d72e30292639d37e85ddf99ac4df784
-rw-r--r--main.lisp21
1 files changed, 14 insertions, 7 deletions
diff --git a/main.lisp b/main.lisp
index 70d9fa0..df03ffe 100644
--- a/main.lisp
+++ b/main.lisp
@@ -152,13 +152,21 @@
(when (and id type acceptp (string= acceptp "t"))
(update-records table
:where [= [id] id]
- :av-pairs `((spam_p "f"))))
+ :av-pairs `((spam_p "f")))
+ ;; Update static files.
+ (update-index-page)
+ (update-comment-feed)
+ (let ((comment/trackback (single-object (select table
+ :where [= [id] id]
+ :flatp t))))
+ (update-journal-entry-page (entry-of comment/trackback))))
(when (and id type acceptp (string= acceptp "f"))
+ ;; In the negative case, there is no need to update
+ ;; any static files, as nothing will have changed
+ ;; there.
(update-records table
:where [= [id] id]
:av-pairs `((spam_p "t")))))
- ;; Update static files.
- (update-journal)
(show-moderation-page)))
(:rebuild (http-send-headers "text/plain; charset=UTF-8")
(update-journal)
@@ -227,10 +235,9 @@
:av-pairs `((spam_p nil))))
(when (eq *site* :nfs.net)
(mail-comment *notification-email* comment entry))
- ;; Update static files.
- (update-comment-feed)
- (update-journal-entry-page entry)
- (update-index-page)))
+ ;; Do not update static files, as the comment
+ ;; will be waiting for moderation anyway.
+ ))
(show-web-journal))
(:post-trackback (with-transaction ()
(let* ((entry (find-entry *post-number*))