[CalendarServer-changes] [4511] CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/ schedule.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Aug 27 12:09:12 PDT 2009


Revision: 4511
          http://trac.macosforge.org/projects/calendarserver/changeset/4511
Author:   cdaboo at apple.com
Date:     2009-08-27 12:09:07 -0700 (Thu, 27 Aug 2009)
Log Message:
-----------
Yield to reactor during loops of recipients and free-busy-set calendars.

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/schedule.py

Modified: CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/schedule.py
===================================================================
--- CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/schedule.py	2009-08-26 20:26:23 UTC (rev 4510)
+++ CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/schedule.py	2009-08-27 19:09:07 UTC (rev 4511)
@@ -27,7 +27,8 @@
 import time
 
 from twisted.internet import reactor
-from twisted.internet.defer import maybeDeferred, succeed, inlineCallbacks, returnValue
+from twisted.internet.defer import maybeDeferred, succeed, inlineCallbacks, returnValue,\
+    Deferred
 from twisted.python.failure import Failure
 from twisted.web2 import responsecode
 from twisted.web2.http import HTTPError, Response
@@ -435,6 +436,14 @@
         # Loop over each recipient and do appropriate action.
         autoresponses = []
         for recipient in recipients:
+
+            # Yield to the reactor once through each loop
+            d = Deferred()
+            def _timedDeferred():
+                d.callback(True)
+            reactor.callLater(0.0, _timedDeferred)
+            yield d
+
             # Get the principal resource for this recipient
             principal = self.principalForCalendarUserAddress(recipient)
 
@@ -498,6 +507,14 @@
                         # Now process free-busy set calendars
                         matchtotal = 0
                         for calendarResourceURL in fbset:
+
+                            # Yield to the reactor once through each loop
+                            d = Deferred()
+                            def _timedDeferred():
+                                d.callback(True)
+                            reactor.callLater(0.0, _timedDeferred)
+                            yield d
+
                             calendarResource = yield request.locateResource(calendarResourceURL)
                             if calendarResource is None or not calendarResource.exists() or not isCalendarCollectionResource(calendarResource):
                                 # We will ignore missing calendars. If the recipient has failed to
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090827/96d07eee/attachment.html>


More information about the calendarserver-changes mailing list