From fedd472e32d33276b33f087c8029de48c69483fa Mon Sep 17 00:00:00 2001 From: Kaz Wolfe Date: Fri, 5 Jul 2024 16:15:39 -0700 Subject: [PATCH] fix: Fix auto-updates every 30 seconds - If no updates are found, properly defer. --- .../Internal/AutoUpdate/AutoUpdateManager.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Dalamud/Plugin/Internal/AutoUpdate/AutoUpdateManager.cs b/Dalamud/Plugin/Internal/AutoUpdate/AutoUpdateManager.cs index 3c122b484c..ebc3851fcb 100644 --- a/Dalamud/Plugin/Internal/AutoUpdate/AutoUpdateManager.cs +++ b/Dalamud/Plugin/Internal/AutoUpdate/AutoUpdateManager.cs @@ -230,10 +230,21 @@ private void OnUpdate(IFramework framework) { 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); + } }); } }