From 3c77625ab35b21fb0e434b0a51352e87d8cc6e13 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Mon, 2 Jun 2025 20:07:08 +0200 Subject: [PATCH] Add delay to plugin hot-reload for file write completion --- .../Tools/PluginSystem/PluginFactory.HotReload.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.HotReload.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.HotReload.cs index 6cd8eb55..7bed742e 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.HotReload.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.HotReload.cs @@ -46,6 +46,9 @@ public static partial class PluginFactory try { LOG.LogInformation($"File changed ({changeType}): {args.FullPath}. Reloading plugins..."); + + // Wait for parallel writes to finish: + await Task.Delay(TimeSpan.FromSeconds(3)); await LoadAll(); await MessageBus.INSTANCE.SendMessage(null, Event.PLUGINS_RELOADED); }