Set timestamps more precicely on the end of the long transactions.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 4 Mar 2015 23:00:29 +0000 (00:00 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 4 Mar 2015 23:00:29 +0000 (00:00 +0100)
jobs.py

diff --git a/jobs.py b/jobs.py
index 84d6a96..725c7ed 100755 (executable)
--- a/jobs.py
+++ b/jobs.py
@@ -362,6 +362,8 @@ for id, job in jobs.iteritems():
                for nodename, node in nodes.iteritems():
                        st.execute("INSERT INTO node (jobid, host, elapsed, map, reduce) VALUES (%s, %s, %s, %s, %s)", (id, nodename, node.elapsed, node.map, node.reduce))
                if debug >= 2: print '[db] job %s nodes updated' % id
+               # better to update timestamp exlicitly on the end of the transaction
+               st.execute('UPDATE job SET changed=NOW() WHERE id=%s', id);
 
        if db:
                db.commit()