snipe-it/app
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
..
Console Remove duplicate settings call 2024-05-06 17:08:16 -07:00
Events
Exceptions
Helpers Added avif to helpers 2024-03-20 12:30:28 +00:00
Http Fix memory-hog query in AssetCountForSidebar middleware 2024-05-10 12:54:40 -07:00
Importer
Jobs
LegacyEncrypter
Listeners Change exceptions to warnings 2024-02-15 12:28:12 +00:00
Models Added ManagedUsers method, additional checks in isDeletable() 2024-05-07 12:07:15 +01:00
Notifications Ensure webhook endpoint is set before attempting to send to google or microsoft 2024-03-07 18:10:10 -08:00
Observers
Policies Fixed tests 2024-04-17 09:26:07 +01:00
Presenters Used localized strings 2024-05-07 17:56:07 +01:00
Providers Merge pull request #14591 from snipe/bug/sc-25258/naive_fix_for_user_scoping 2024-04-17 21:49:53 +01:00
Services
View Add comment 2024-04-11 17:23:28 -07:00