You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@steve.apache.org by hu...@apache.org on 2016/02/07 09:49:05 UTC

svn commit: r1728924 - /steve/trunk/pysteve/lib/backends/es.py

Author: humbedooh
Date: Sun Feb  7 08:49:04 2016
New Revision: 1728924

URL: http://svn.apache.org/viewvc?rev=1728924&view=rev
Log:
use same timestamp for backlog and final tally, so as to be able to compare

Modified:
    steve/trunk/pysteve/lib/backends/es.py

Modified: steve/trunk/pysteve/lib/backends/es.py
URL: http://svn.apache.org/viewvc/steve/trunk/pysteve/lib/backends/es.py?rev=1728924&r1=1728923&r2=1728924&view=diff
==============================================================================
--- steve/trunk/pysteve/lib/backends/es.py (original)
+++ steve/trunk/pysteve/lib/backends/es.py Sun Feb  7 08:49:04 2016
@@ -160,13 +160,14 @@ class ElasticSearchBackend:
     def vote(self,electionID, issueID, uid, vote):
         "Casts a vote on an issue"
         eid = hashlib.sha224(electionID + ":" + issueID + ":" + uid).hexdigest()
+        now = time.time()
         self.es.index(index="steve", doc_type="votes", id=eid, body =
             {
                 'issue': issueID,
                 'election': electionID,
                 'key': uid,
                 'data': {
-                    'timestamp': time.time(),
+                    'timestamp': now,
                     'vote': vote
                 }
             }
@@ -178,7 +179,7 @@ class ElasticSearchBackend:
                 'election': electionID,
                 'key': uid,
                 'data': {
-                    'timestamp': time.time(),
+                    'timestamp': now,
                     'vote': vote
                 }
             }