[CalendarServer-changes] [12984] twext/trunk/twext/who/aggregate.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu Mar 20 18:05:35 PDT 2014
Revision: 12984
http://trac.calendarserver.org//changeset/12984
Author: sagen at apple.com
Date: 2014-03-20 18:05:35 -0700 (Thu, 20 Mar 2014)
Log Message:
-----------
Aggregate now forwards on updateRecords and removeRecords to sub services
Modified Paths:
--------------
twext/trunk/twext/who/aggregate.py
Modified: twext/trunk/twext/who/aggregate.py
===================================================================
--- twext/trunk/twext/who/aggregate.py 2014-03-21 01:02:47 UTC (rev 12983)
+++ twext/trunk/twext/who/aggregate.py 2014-03-21 01:05:35 UTC (rev 12984)
@@ -25,7 +25,9 @@
from itertools import chain
-from twisted.internet.defer import gatherResults, FirstError, succeed
+from twisted.internet.defer import (
+ gatherResults, FirstError, succeed, inlineCallbacks
+)
from .idirectory import DirectoryConfigurationError, IDirectoryService
from .directory import (
@@ -109,3 +111,23 @@
if recordType in service.recordTypes():
return service.recordsWithRecordType(recordType)
return succeed(())
+
+
+ @inlineCallbacks
+ def updateRecords(self, records, create=False):
+ for record in records:
+ for service in self.services:
+ if record.recordType in service.recordTypes():
+ yield service.updateRecords([record], create=create)
+
+
+ @inlineCallbacks
+ def removeRecords(self, uids):
+ # FIXME: since we don't know which sub-service owns each uid, we
+ # currently try removing the uids in each sub-service, ignoring
+ # errors.
+ for service in self.services:
+ try:
+ yield service.removeRecords(uids)
+ except:
+ pass
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140320/4450b2d1/attachment.html>
More information about the calendarserver-changes
mailing list