[CalendarServer-changes] [7794] CalendarServer/trunk/contrib/performance/loadtest/ical.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 14 12:28:38 PDT 2011


Revision: 7794
          http://trac.macosforge.org/projects/calendarserver/changeset/7794
Author:   cdaboo at apple.com
Date:     2011-07-14 12:28:38 -0700 (Thu, 14 Jul 2011)
Log Message:
-----------
Make sure initial load of existing data occurs. Make sure ctag is properly recorded after it changes.

Modified Paths:
--------------
    CalendarServer/trunk/contrib/performance/loadtest/ical.py

Modified: CalendarServer/trunk/contrib/performance/loadtest/ical.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/ical.py	2011-07-14 16:46:52 UTC (rev 7793)
+++ CalendarServer/trunk/contrib/performance/loadtest/ical.py	2011-07-14 19:28:38 UTC (rev 7794)
@@ -452,8 +452,14 @@
         @inlineCallbacks
         def cbCalendars(calendars):
             for cal in calendars:
-                if self._calendars.setdefault(cal.url, cal).ctag != cal.ctag or True:
+                if cal.url not in self._calendars:
+                    # Calendar seen for the first time - reload it
+                    self._calendars[cal.url] = cal
                     yield self._updateCalendar(cal)
+                elif self._calendars[cal.url].ctag != cal.ctag:
+                    # Calendar changed - update to new ctag and reload
+                    self._calendars[cal.url].ctag = cal.ctag
+                    yield self._updateCalendar(cal)
         d.addCallback(cbCalendars)
         d = self._newOperation("poll", d)
         def ebCalendars(reason):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110714/757a5b30/attachment.html>


More information about the calendarserver-changes mailing list