diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 75c5911036..5720b9d5e4 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -457,10 +457,15 @@ def builddashboard( request, build_id ): | |||
457 | npkg = 0 | 457 | npkg = 0 |
458 | pkgsz = 0 | 458 | pkgsz = 0 |
459 | package = None | 459 | package = None |
460 | for package in Package.objects.filter(id__in = [x.package_id for x in t.target_installed_package_set.all()]): | 460 | # Chunk the query to avoid "too many SQL variables" error |
461 | pkgsz = pkgsz + package.size | 461 | package_set = t.target_installed_package_set.all() |
462 | if package.installed_name: | 462 | package_set_len = len(package_set) |
463 | npkg = npkg + 1 | 463 | for ps_start in range(0,package_set_len,500): |
464 | ps_stop = min(ps_start+500,package_set_len) | ||
465 | for package in Package.objects.filter(id__in = [x.package_id for x in package_set[ps_start:ps_stop]]): | ||
466 | pkgsz = pkgsz + package.size | ||
467 | if package.installed_name: | ||
468 | npkg = npkg + 1 | ||
464 | elem['npkg'] = npkg | 469 | elem['npkg'] = npkg |
465 | elem['pkgsz'] = pkgsz | 470 | elem['pkgsz'] = pkgsz |
466 | ti = Target_Image_File.objects.filter(target_id = t.id) | 471 | ti = Target_Image_File.objects.filter(target_id = t.id) |