Skip to content

Commit

Permalink
Merge pull request #14711 from snipe/jerm/fix-all-query-in-sidebar-mi…
Browse files Browse the repository at this point in the history
…ddleware

Fix memory-hog query in AssetCountForSidebar middleware
  • Loading branch information
snipe committed May 11, 2024
2 parents 46779ca + 2adc4ff commit 2decc3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Middleware/AssetCountForSidebar.php
Expand Up @@ -35,7 +35,7 @@ public function handle($request, Closure $next)
}

try {
$total_assets = Asset::all()->count();
$total_assets = Asset::count();
if ($settings->show_archived_in_list != '1') {
$total_assets -= Asset::Archived()->count();
}
Expand Down

0 comments on commit 2decc3d

Please sign in to comment.