Skip to content

Commit 2decc3d

Browse files
authored
Merge pull request #14711 from snipe/jerm/fix-all-query-in-sidebar-middleware
Fix memory-hog query in AssetCountForSidebar middleware
2 parents 46779ca + 2adc4ff commit 2decc3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Http/Middleware/AssetCountForSidebar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function handle($request, Closure $next)
3535
}
3636

3737
try {
38-
$total_assets = Asset::all()->count();
38+
$total_assets = Asset::count();
3939
if ($settings->show_archived_in_list != '1') {
4040
$total_assets -= Asset::Archived()->count();
4141
}

0 commit comments

Comments
 (0)