timeline: enable aggregation for month view
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/877/head
parent
7b7ecab8e2
commit
27e9b093bf
|
@ -45,10 +45,8 @@ class DaysController extends GenericApiController
|
||||||
$this->getTransformations(),
|
$this->getTransformations(),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$this->isMonthView()) {
|
// Preload some day responses
|
||||||
// Preload some day responses
|
$this->preloadDays($list);
|
||||||
$this->preloadDays($list);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reverse response if requested.
|
// Reverse response if requested.
|
||||||
if ($this->isReverse()) {
|
if ($this->isReverse()) {
|
||||||
|
|
|
@ -906,8 +906,13 @@ export default defineComponent({
|
||||||
// Aggregate fetch requests
|
// Aggregate fetch requests
|
||||||
this.fetchDayQueue.push(dayId);
|
this.fetchDayQueue.push(dayId);
|
||||||
|
|
||||||
// Only single queries allowed for month vie
|
// If the queue has gotten large enough, just expire immediately
|
||||||
if (now || this.isMonthView) {
|
// This is to prevent a large number of requests from being queued
|
||||||
|
now ||= this.fetchDayQueue.length >= 16;
|
||||||
|
now ||= this.fetchDayQueue.reduce((sum, dayId) => sum + this.heads[dayId]?.day?.count ?? 0, 0) > 256;
|
||||||
|
|
||||||
|
// Process immediately
|
||||||
|
if (now) {
|
||||||
return this.fetchDayExpire();
|
return this.fetchDayExpire();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue