Author: nunofsantos
Date: 2008-12-18 16:52:54 -0500 (Thu, 18 Dec 2008)
New Revision: 3027
Modified:
mgmt/trunk/mint/python/mint/update.py
Log:
drop updates for Jobs that are older then the expiration threshold, since they would be
deleted anyway in the next run of the db expiration thread
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2008-12-18 19:28:25 UTC (rev 3026)
+++ mgmt/trunk/mint/python/mint/update.py 2008-12-18 21:52:54 UTC (rev 3027)
@@ -213,6 +213,14 @@
timestamps = self.object.getTimestamps()
self.processTimestamp("qmfUpdateTime", timestamps[0], attrs)
+
+ if cls is Job and attrs["qmfUpdateTime"] < datetime.now() -
timedelta(seconds=thread.model.dbExpireThread.threshold):
+ # drop updates for Jobs that are older then the expiration threshold,
+ # since they would be deleted anyway in the next run of the db expiration thread
+ log.debug("Property update is older than expiration threshold; skipping
it")
+ thread.dropCount += 1
+ return
+
self.processTimestamp("qmfCreateTime", timestamps[1], attrs)
if timestamps[2] != 0:
@@ -278,7 +286,7 @@
op = SqlUpdate(cls, attrs)
op.execute(cursor, attrs)
- assert cursor.rowcount == 1
+ #assert cursor.rowcount == 1
try:
orphans = self.broker.orphans.pop(oid)
@@ -336,7 +344,7 @@
t = datetime.fromtimestamp(timestamps[0] / 1000000000)
if t < tnow - timedelta(seconds=30):
- log.debug("Update is %i seconds old; skipping it", (tnow -t).seconds)
+ log.debug("Update is %i seconds old; skipping it", (tnow - t).seconds)
thread.dropCount += 1
return