mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -08:00
2adc4ffa96
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. |
||
---|---|---|
.. | ||
AssetCountForSidebar.php | ||
CheckForDebug.php | ||
CheckForSetup.php | ||
CheckForTwoFactor.php | ||
CheckLocale.php | ||
CheckPermissions.php | ||
CheckUserIsActivated.php | ||
EncryptCookies.php | ||
NoSessionStore.php | ||
PreventBackHistory.php | ||
PreventRequestsDuringMaintenance.php | ||
RedirectIfAuthenticated.php | ||
SecurityHeaders.php | ||
TrimStrings.php | ||
TrustHosts.php | ||
TrustProxies.php | ||
VerifyCsrfToken.php |