diff backend/couchdb/FeedEntry.py @ 192:9d422fa90096

optimize marking feed entries as read: do not round trip to the database if the entry was already marked as read
author dirk
date Wed, 21 Sep 2011 13:23:25 +0200
parents e5d492595bdb
children bb3c851b18b1
line wrap: on
line diff
--- a/backend/couchdb/FeedEntry.py	Wed Sep 21 13:21:17 2011 +0200
+++ b/backend/couchdb/FeedEntry.py	Wed Sep 21 13:23:25 2011 +0200
@@ -36,8 +36,9 @@
         return list(viewResults)
 
     def markRead(self, database):
-        self.read = True
-        self.store(database)
+        if not self.read:
+            self.read = True
+            self.store(database)
 
     def toggleRead(self, database):
         if self.read: