[CalendarServer-changes] [3945] CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/ index.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Apr 1 08:00:59 PDT 2009


Revision: 3945
          http://trac.macosforge.org/projects/calendarserver/changeset/3945
Author:   cdaboo at apple.com
Date:     2009-04-01 08:00:59 -0700 (Wed, 01 Apr 2009)
Log Message:
-----------
Properly index events in the future - merged from trunk.

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

Modified: CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/index.py
===================================================================
--- CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/index.py	2009-04-01 15:00:00 UTC (rev 3944)
+++ CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/index.py	2009-04-01 15:00:59 UTC (rev 3945)
@@ -408,7 +408,15 @@
         """
         uid = calendar.resourceUID()
 
-        expand_max = datetime.date.today() + default_future_expansion_duration
+        # Decide how far to expand based on the component
+        master = calendar.masterComponent()
+        if master is None or not calendar.isRecurring() and not calendar.isRecurringUnbounded():
+            # When there is no master we have a set of overridden components - index them all.
+            # When there is one instance - index it.
+            # When bounded - index all.
+            expand_max = datetime.datetime(2100, 1, 1, 0, 0, 0, tzinfo=utc)
+        else:
+            expand_max = datetime.date.today() + default_future_expansion_duration
 
         instances = calendar.expandTimeRanges(expand_max)
         for key in instances:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090401/516da18a/attachment.html>


More information about the calendarserver-changes mailing list