[CalendarServer-changes] [10846] CalendarServer/branches/users/sagen/testing/calendarserver/push/ notifier.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Mar 5 10:50:35 PST 2013
Revision: 10846
http://trac.calendarserver.org//changeset/10846
Author: sagen at apple.com
Date: 2013-03-05 10:50:34 -0800 (Tue, 05 Mar 2013)
Log Message:
-----------
Try to delete duplicate push work items
Modified Paths:
--------------
CalendarServer/branches/users/sagen/testing/calendarserver/push/notifier.py
Modified: CalendarServer/branches/users/sagen/testing/calendarserver/push/notifier.py
===================================================================
--- CalendarServer/branches/users/sagen/testing/calendarserver/push/notifier.py 2013-03-05 18:50:18 UTC (rev 10845)
+++ CalendarServer/branches/users/sagen/testing/calendarserver/push/notifier.py 2013-03-05 18:50:34 UTC (rev 10846)
@@ -24,6 +24,7 @@
from twext.enterprise.dal.record import fromTable
from twext.enterprise.queue import WorkItem
from txdav.common.datastore.sql_tables import schema
+from twext.enterprise.dal.syntax import Delete
log = Logger()
@@ -36,7 +37,11 @@
@inlineCallbacks
def doWork(self):
- # FIXME: Coalescing goes here?
+ # Delete all other work items with the same pushID
+ yield Delete(From=self.table,
+ Where=self.table.PUSH_ID == self.pushID
+ ).on(self.transaction)
+
pushDistributor = self.transaction._pushDistributor
if pushDistributor is not None:
yield pushDistributor.enqueue(self.pushID)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130305/fc1e8164/attachment.html>
More information about the calendarserver-changes
mailing list