snipe-it/app/Http/Middleware
Jeremy Price 2adc4ffa96 Fix memory-hog query in AssetCountForSidebar middleware
https://github.com/snipe/snipe-it/pull/14702/files introduced a bug
where instead of doing a quick `select count(*)` of assets, it did a `select *` of
assets, moving the count from the database to the PHP process.

This caused OOM issues in memory-constrained environments with lots of
assets, and also presented a speed issue even when memory limited were
increased.

Additionally, given this populates the sidebar, this was likely an issue
on every page load that included the sidebar.

The fix is simply removing the `all()->`, ending up with Asset::count(),
which yields the desired `select count(*)` DB query.
2024-05-10 12:54:40 -07:00
..
AssetCountForSidebar.php Fix memory-hog query in AssetCountForSidebar middleware 2024-05-10 12:54:40 -07:00
CheckForDebug.php
CheckForSetup.php Fixed #12772 - use the APP_URL config more consistently 2023-04-05 16:05:40 -07:00
CheckForTwoFactor.php
CheckLocale.php Fix [sc-25008] - correct and improve legacy language warnings 2024-03-08 14:04:21 +00:00
CheckPermissions.php
CheckUserIsActivated.php
EncryptCookies.php
NoSessionStore.php
PreventBackHistory.php
PreventRequestsDuringMaintenance.php
RedirectIfAuthenticated.php
SecurityHeaders.php Reverting CSP change 2024-03-01 12:25:14 +00:00
TrimStrings.php
TrustHosts.php
TrustProxies.php
VerifyCsrfToken.php