Merge pull request #14711 from snipe/jerm/fix-all-query-in-sidebar-middleware

Fix memory-hog query in AssetCountForSidebar middleware
This commit is contained in:
snipe 2024-05-11 01:35:09 +01:00 committed by GitHub
commit 2decc3d6d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,7 +35,7 @@ class AssetCountForSidebar
} }
try { try {
$total_assets = Asset::all()->count(); $total_assets = Asset::count();
if ($settings->show_archived_in_list != '1') { if ($settings->show_archived_in_list != '1') {
$total_assets -= Asset::Archived()->count(); $total_assets -= Asset::Archived()->count();
} }