[CalendarServer-changes] [3941] CalendarServer/trunk/twistedcaldav/index.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Mar 31 13:58:52 PDT 2009
Revision: 3941
http://trac.macosforge.org/projects/calendarserver/changeset/3941
Author: cdaboo at apple.com
Date: 2009-03-31 13:58:52 -0700 (Tue, 31 Mar 2009)
Log Message:
-----------
Properly index events in the future.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/index.py
Modified: CalendarServer/trunk/twistedcaldav/index.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/index.py 2009-03-31 20:56:48 UTC (rev 3940)
+++ CalendarServer/trunk/twistedcaldav/index.py 2009-03-31 20:58:52 UTC (rev 3941)
@@ -470,14 +470,22 @@
"""
uid = calendar.resourceUID()
- if expand_until:
- expand = expand_until
+ # 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 = datetime.datetime(2100, 1, 1, 0, 0, 0, tzinfo=utc)
else:
- expand = datetime.date.today() + default_future_expansion_duration
+ if expand_until:
+ expand = expand_until
+ else:
+ expand = datetime.date.today() + default_future_expansion_duration
+
+ if expand > (datetime.date.today() + maximum_future_expansion_duration):
+ raise IndexedSearchException
- if expand > (datetime.date.today() + maximum_future_expansion_duration):
- raise IndexedSearchException
-
instances = calendar.expandTimeRanges(expand)
self._delete_from_db(name, uid)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090331/bb858434/attachment-0001.html>
More information about the calendarserver-changes
mailing list