fix: Fix auto-updates every 30 seconds (#1899)

- If no updates are found, properly defer.
This commit is contained in:
KazWolfe 2024-07-07 11:39:10 -07:00 committed by GitHub
parent d41682b66e
commit 82e6476ab6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -240,10 +240,21 @@ internal class AutoUpdateManager : IServiceType
{
Log.Error(t.Exception!, "Failed to reload plugin masters for auto-update");
}
this.NotifyUpdatesAreAvailable(
this.GetAvailablePluginUpdates(
DecideUpdateListingRestriction(behavior)));
var updatable = this.GetAvailablePluginUpdates(
DecideUpdateListingRestriction(behavior));
if (updatable.Count > 0)
{
this.NotifyUpdatesAreAvailable(updatable);
}
else
{
this.nextUpdateCheckTime = DateTime.Now + TimeBetweenUpdateChecks;
Log.Verbose(
"Auto update found nothing to do, next update at {Time}",
this.nextUpdateCheckTime);
}
});
}
}