Add delay to plugin hot-reload for file write completion

This commit is contained in:
Thorsten Sommer 2025-06-02 20:07:08 +02:00
parent 041cbc568b
commit 3c77625ab3
No known key found for this signature in database
GPG Key ID: B0B7E2FC074BF1F5

View File

@ -46,6 +46,9 @@ public static partial class PluginFactory
try try
{ {
LOG.LogInformation($"File changed ({changeType}): {args.FullPath}. Reloading plugins..."); LOG.LogInformation($"File changed ({changeType}): {args.FullPath}. Reloading plugins...");
// Wait for parallel writes to finish:
await Task.Delay(TimeSpan.FromSeconds(3));
await LoadAll(); await LoadAll();
await MessageBus.INSTANCE.SendMessage<bool>(null, Event.PLUGINS_RELOADED); await MessageBus.INSTANCE.SendMessage<bool>(null, Event.PLUGINS_RELOADED);
} }