From 82e6476ab6660ef2267f567aaf7b10e76a949f96 Mon Sep 17 00:00:00 2001 From: KazWolfe Date: Sun, 7 Jul 2024 11:39:10 -0700 Subject: [PATCH] fix: Fix auto-updates every 30 seconds (#1899) - 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 fd0df6884..88fa5d23b 100644 --- a/Dalamud/Plugin/Internal/AutoUpdate/AutoUpdateManager.cs +++ b/Dalamud/Plugin/Internal/AutoUpdate/AutoUpdateManager.cs @@ -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); + } }); } }