Make day preload lighter
parent
dffd84ba20
commit
524c029134
|
@ -672,11 +672,13 @@ class ApiController extends Controller
|
||||||
$preloadDayIds = [];
|
$preloadDayIds = [];
|
||||||
$preloadDays = [];
|
$preloadDays = [];
|
||||||
foreach ($days as &$day) {
|
foreach ($days as &$day) {
|
||||||
|
if ($day['count'] <= 0) continue;
|
||||||
|
|
||||||
$preloaded += $day['count'];
|
$preloaded += $day['count'];
|
||||||
$preloadDayIds[] = $day['dayid'];
|
$preloadDayIds[] = $day['dayid'];
|
||||||
$preloadDays[] = &$day;
|
$preloadDays[] = &$day;
|
||||||
|
|
||||||
if ($preloaded >= 50) { // should be enough
|
if ($preloaded >= 50 || count($preloadDayIds) > 5) { // should be enough
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue