host collection dashboard widget slows down as errata count grows
The host collection dashboard widget gets slower and slower as the number of errata grows. If there are 500K errata applicable in a large host collection, it can take upwards of 50 seconds to render.
It appears that there are some areas that find critical and non-critical errata by looping over all the errata in code, instead of via db calls.
Fixes #16893 - rely on DB to determine errata type in collection
Previously, the errata checks in host collections would iterate over
all errata in memory to determine if any errata were critical. If there
were a lot of errata to iterate over (say, over 500K), this could take
nearly a minute and force passenger to consume lots of CPU.
This patch alters this behavior so a DB query is used, times appear to
be sub-second now.