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 Track changes on asset checkin/out 2023-09-01 13:12:07 +10:00
Exceptions rm unnecessary import 2023-11-01 11:34:15 -05:00
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 that's all of 'em 2024-01-25 20:04:02 -06:00
Jobs Version 3 - hold onto your butts 2016-03-25 01:18:05 -07:00
LegacyEncrypter Minor code cleanup bits and bobs (#6805) 2019-03-13 20:12:03 -07:00
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 changes from a note to a source 2024-01-30 15:14:59 -06:00
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 Fixed pluralization bug due to dashed-locale names instead of underscored 2024-01-26 15:40:55 +00:00
View Add comment 2024-04-11 17:23:28 -07:00