Make day preload lighter

old-stable24
Varun Patil 2022-10-26 15:18:18 -07:00
parent dffd84ba20
commit 524c029134
1 changed files with 3 additions and 1 deletions

View File

@ -672,11 +672,13 @@ class ApiController extends Controller
$preloadDayIds = [];
$preloadDays = [];
foreach ($days as &$day) {
if ($day['count'] <= 0) continue;
$preloaded += $day['count'];
$preloadDayIds[] = $day['dayid'];
$preloadDays[] = &$day;
if ($preloaded >= 50) { // should be enough
if ($preloaded >= 50 || count($preloadDayIds) > 5) { // should be enough
break;
}
}