fix: Make auto-update work again, the lazy way (#1592)

* fix: Make auto-update work again, the lazy way.

- Move auto-update to run on the first `Notice` message for parity with the welcome message.
- Add some logging in a few critical places to make things nicer.

* fix overzealous IDE complaints

* code-review comments

- Remove stray imports that the IDE included
- Remove fixme to move auto-updates (for now)

* Lazy retry auto-update
This commit is contained in:
KazWolfe 2024-01-13 11:17:26 -08:00 committed by GitHub
parent 3c7900ea13
commit 86b7c29e94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 12 deletions

View file

@ -958,7 +958,7 @@ internal partial class PluginManager : IDisposable, IServiceType
autoUpdate ? PluginListInvalidationKind.AutoUpdate : PluginListInvalidationKind.Update,
updatedList.Select(x => x.InternalName));
Log.Information("Plugin update OK.");
Log.Information("Plugin update OK. {updateCount} plugins updated.", updatedList.Length);
return updatedList;
}
@ -1581,6 +1581,8 @@ internal partial class PluginManager : IDisposable, IServiceType
private void DetectAvailablePluginUpdates()
{
Log.Debug("Starting plugin update check...");
lock (this.pluginListLock)
{
this.updatablePluginsList.Clear();
@ -1615,10 +1617,12 @@ internal partial class PluginManager : IDisposable, IServiceType
}
}
}
Log.Debug("Update check found {updateCount} available updates.", this.updatablePluginsList.Count);
}
private void NotifyAvailablePluginsChanged()
{
{
this.DetectAvailablePluginUpdates();
this.OnAvailablePluginsChanged?.InvokeSafely();