[CalendarServer-changes] [13237] CalendarServer/trunk/txdav/who/augment.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Apr 9 19:00:00 PDT 2014


Revision: 13237
          http://trac.calendarserver.org//changeset/13237
Author:   sagen at apple.com
Date:     2014-04-09 19:00:00 -0700 (Wed, 09 Apr 2014)
Log Message:
-----------
augments uses store.inTransaction

Modified Paths:
--------------
    CalendarServer/trunk/txdav/who/augment.py

Modified: CalendarServer/trunk/txdav/who/augment.py
===================================================================
--- CalendarServer/trunk/txdav/who/augment.py	2014-04-10 01:55:12 UTC (rev 13236)
+++ CalendarServer/trunk/txdav/who/augment.py	2014-04-10 02:00:00 UTC (rev 13237)
@@ -379,9 +379,14 @@
     def groups(self):
         augmented = []
 
-        txn = self.service._store.newTransaction(label="AugmentedDirectoryRecord.groups")
-        groupUIDs = yield txn.groupsFor(self.uid)
+        def _groupsFor(txn):
+            return txn.groupsFor(self.uid)
 
+        groupUIDs = yield self.service._store.inTransaction(
+            "AugmentedDirectoryRecord.groups",
+            _groupsFor
+        )
+
         for groupUID in groupUIDs:
             groupRecord = yield self.service.recordWithUID(
                 groupUID
@@ -389,8 +394,6 @@
             if groupRecord:
                 augmented.append((yield self.service._augment(groupRecord)))
 
-        yield txn.commit()
-
         returnValue(augmented)
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140409/47b5c8d7/attachment.html>


More information about the calendarserver-changes mailing list