[27540] in Source-Commits

home help back first fref pref prev next nref lref last post

python-discuss commit: Cleanup semantics of touch()

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Mon Dec 9 14:22:13 2013

Date: Mon, 9 Dec 2013 14:22:06 -0500
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201312091922.rB9JM6Wb013932@drugstore.mit.edu>
To: source-commits@MIT.EDU

https://github.com/mit-athena/python-discuss/commit/21828fca7a85cfed029523745afffa0314e33a9e
commit 21828fca7a85cfed029523745afffa0314e33a9e
Author: Jonathan Reed <jdreed@mit.edu>
Date:   Thu Nov 21 15:56:35 2013 -0500

    Cleanup semantics of touch()
    
    We should only bump the highest-read transaction if we've read a
    newer one.  We always bump the timestamp.

 discuss/rcfile.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/discuss/rcfile.py b/discuss/rcfile.py
index c633692..1f507af 100644
--- a/discuss/rcfile.py
+++ b/discuss/rcfile.py
@@ -124,7 +124,8 @@ class RCFile:
             raise ValueError("Attempted to touch the non-existent meeting")
 
         self.entries[meeting]['last_timestamp'] = int(time.time())
-        self.entries[meeting]['last_transaction'] = int(last)
+        if int(last) > self.entries[meeting]['last_transaction']:
+            self.entries[meeting]['last_transaction'] = int(last)
 
     def add(self, meeting):
         """Adds a given meeting object to .meetings file."""

home help back first fref pref prev next nref lref last post