Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14724290
D13141.id31744.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13141.id31744.diff
View Options
diff --git a/src/applications/calendar/query/PhabricatorCalendarEventQuery.php b/src/applications/calendar/query/PhabricatorCalendarEventQuery.php
--- a/src/applications/calendar/query/PhabricatorCalendarEventQuery.php
+++ b/src/applications/calendar/query/PhabricatorCalendarEventQuery.php
@@ -112,6 +112,7 @@
$map = array();
$instance_sequence_pairs = array();
+ $enforced_end = null;
foreach ($events as $key => $event) {
$sequence_start = 0;
@@ -159,6 +160,8 @@
$end = $event->getRecurrenceEndDate();
} else if ($this->rangeEnd) {
$end = $this->rangeEnd;
+ } else {
+ $end = $enforced_end;
}
if ($end) {
@@ -167,6 +170,9 @@
$sequence_end++;
$datetime->modify($modify_key);
$date = $datetime->format('U');
+ if ($sequence_end > $this->getRawResultLimit() + $sequence_start) {
+ break;
+ }
}
} else {
$sequence_end = $this->getRawResultLimit() + $sequence_start;
@@ -175,15 +181,25 @@
$sequence_start = max(1, $sequence_start);
for ($index = $sequence_start; $index < $sequence_end; $index++) {
- $instance_sequence_pairs[] = array($event->getPHID(), $index);
$events[] = $event->generateNthGhost($index, $viewer);
+ }
- $last_key = last_key($events);
- $map[$event->getPHID()][$index] = $last_key;
+ if (count($events) == $this->getRawResultLimit()) {
+ $events = msort($events, 'getDateFrom');
+ $events = array_slice($events, 0, $this->getRawResultLimit(), true);
+ $enforced_end = last($events)->getDateFrom();
}
}
}
+ foreach ($events as $key => $event) {
+ if ($event->getIsGhostEvent()) {
+ $index = $event->getSequenceIndex();
+ $instance_sequence_pairs[] = array($event->getPHID(), $index);
+ $map[$event->getPHID()][$index] = $key;
+ }
+ }
+
if (count($instance_sequence_pairs) > 0) {
$sub_query = id(new PhabricatorCalendarEventQuery())
->setViewer($viewer)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 19, 1:11 AM (49 m, 41 s)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7014764
Default Alt Text
D13141.id31744.diff (2 KB)
Attached To
Mode
D13141: Attempt to optimize ghost generating code.
Attached
Detach File
Event Timeline
Log In to Comment