mirror of
https://git.proxmox.com/git/fwupd
synced 2025-07-27 09:46:25 +00:00
Speed up regenerating the MOTD
This is regenerated on every device hotplug event, and although infrequent there is no point doing all that CPU-heavy requirement checking for no reason.
This commit is contained in:
parent
9fdfcfe499
commit
fbb6f7fd66
@ -70,6 +70,8 @@ fu_engine_update_motd(FuEngine *self, GError **error)
|
||||
g_autoptr(GPtrArray) rels = NULL;
|
||||
|
||||
/* get the releases for this device */
|
||||
if (!fu_device_has_flag(dev, FWUPD_DEVICE_FLAG_UPDATABLE))
|
||||
continue;
|
||||
rels =
|
||||
fu_engine_get_upgrades(self, request, fwupd_device_get_id(dev), NULL);
|
||||
if (rels == NULL)
|
||||
@ -80,6 +82,8 @@ fu_engine_update_motd(FuEngine *self, GError **error)
|
||||
for (guint i = 0; i < devices->len; i++) {
|
||||
FwupdDevice *dev = g_ptr_array_index(devices, i);
|
||||
g_autoptr(FwupdRelease) rel = NULL;
|
||||
if (!fu_device_has_flag(dev, FWUPD_DEVICE_FLAG_UPDATABLE))
|
||||
continue;
|
||||
rel = fu_engine_get_release_with_tag(self,
|
||||
request,
|
||||
dev,
|
||||
|
Loading…
Reference in New Issue
Block a user