[CalendarServer-changes] [9696] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon Aug 13 17:12:06 PDT 2012


Revision: 9696
          http://trac.macosforge.org/projects/calendarserver/changeset/9696
Author:   glyph at apple.com
Date:     2012-08-13 17:12:05 -0700 (Mon, 13 Aug 2012)
Log Message:
-----------
Adjust post-commit hooks to wait for Deferreds again, when they would have before the removal of 'immediately'.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/base/datastore/util.py
    CalendarServer/trunk/txdav/caldav/datastore/sql.py

Property Changed:
----------------
    CalendarServer/trunk/

Modified: CalendarServer/trunk/txdav/base/datastore/util.py
===================================================================
--- CalendarServer/trunk/txdav/base/datastore/util.py	2012-08-13 21:46:47 UTC (rev 9695)
+++ CalendarServer/trunk/txdav/base/datastore/util.py	2012-08-14 00:12:05 UTC (rev 9696)
@@ -70,19 +70,13 @@
 
 
     def setAfterCommit(self, transaction, key, value):
-        def setit():
-            # Don't return Deferred; let the postCommit chain continue.
-            self.set(key, value)
-        transaction.postCommit(setit)
+        transaction.postCommit(lambda: self.set(key, value))
 
     def invalidateAfterCommit(self, transaction, key):
         # Invalidate now (so that operations within this transaction see it)
         # and *also* post-commit (because there could be a scheduled setAfterCommit
         # for this key)
-        def delit():
-            # Don't return Deferred; let the postCommit chain continue.
-            self.delete(key)
-        transaction.postCommit(delit)
+        transaction.postCommit(lambda: self.delete(key))
         return self.delete(key)
 
     # Home child objects by name

Modified: CalendarServer/trunk/txdav/caldav/datastore/sql.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/sql.py	2012-08-13 21:46:47 UTC (rev 9695)
+++ CalendarServer/trunk/txdav/caldav/datastore/sql.py	2012-08-14 00:12:05 UTC (rev 9696)
@@ -144,7 +144,7 @@
         for dropboxID, path in rows:
             attachment = Attachment._attachmentPathRoot(self._txn, dropboxID).child(path)
             if attachment.exists():
-                self._txn.postCommit(attachment.remove)
+                yield attachment.remove()
 
         yield Delete(
             From=at,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120813/1af9db71/attachment.html>


More information about the calendarserver-changes mailing list