From: František Dvořák Date: Wed, 4 Mar 2015 23:00:29 +0000 (+0100) Subject: Set timestamps more precicely on the end of the long transactions. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=9d2d8fa66b5e6548754f978e1dea015609b50ca1;p=hadoop-jobstat.git Set timestamps more precicely on the end of the long transactions. --- diff --git a/jobs.py b/jobs.py index 84d6a96..725c7ed 100755 --- 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()