aboutsummaryrefslogtreecommitdiff
path: root/lib/Plugins.Runtime
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-04-19 01:42:00 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-04-19 01:42:00 -0400
commitd65aa4f010adbd6c8162eb08c5787550e27d3e47 (patch)
tree3849d77ef8694d7c24c0922560e7a9edb064d9bb /lib/Plugins.Runtime
parente67084af248f1302aa65f31e824d075f992b304c (diff)
Fix watcher pause, add base64urlencode
Diffstat (limited to 'lib/Plugins.Runtime')
-rw-r--r--lib/Plugins.Runtime/src/AsmFileWatcher.cs13
-rw-r--r--lib/Plugins.Runtime/src/RuntimePluginLoader.cs3
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/Plugins.Runtime/src/AsmFileWatcher.cs b/lib/Plugins.Runtime/src/AsmFileWatcher.cs
index 0aee21b..f2a0ca7 100644
--- a/lib/Plugins.Runtime/src/AsmFileWatcher.cs
+++ b/lib/Plugins.Runtime/src/AsmFileWatcher.cs
@@ -52,12 +52,13 @@ namespace VNLib.Plugins.Runtime
{
Filter = "*.dll",
EnableRaisingEvents = false,
- IncludeSubdirectories = false,
- NotifyFilter = NotifyFilters.LastWrite
+ IncludeSubdirectories = true,
+ NotifyFilter = NotifyFilters.LastWrite,
};
//Configure listener
_watcher.Changed += OnFileChanged;
+ _watcher.Created += OnFileChanged;
_watcher.EnableRaisingEvents = true;
@@ -73,16 +74,20 @@ namespace VNLib.Plugins.Runtime
return;
}
+ //Set pause flag
+ _pause = true;
+
//Restart the timer to trigger reload event on elapsed
_delayTimer.Restart(_loaderSource.Config.ReloadDelay);
}
private void OnTimeout(object? state)
{
- //Fire event
- Handler.OnPluginUnloaded(_loaderSource);
_delayTimer.Stop();
+ //Fire event, let exception crash app
+ Handler.OnPluginUnloaded(_loaderSource);
+
//Clear pause flag
_pause = false;
}
diff --git a/lib/Plugins.Runtime/src/RuntimePluginLoader.cs b/lib/Plugins.Runtime/src/RuntimePluginLoader.cs
index e581a86..e7b9404 100644
--- a/lib/Plugins.Runtime/src/RuntimePluginLoader.cs
+++ b/lib/Plugins.Runtime/src/RuntimePluginLoader.cs
@@ -40,8 +40,7 @@ namespace VNLib.Plugins.Runtime
public sealed class RuntimePluginLoader : VnDisposeable, IPluginReloadEventHandler
{
private static readonly IPluginAssemblyWatcher Watcher = new AssemblyWatcher();
-
- //private readonly IPluginAssemblyWatcher Watcher;
+
private readonly IPluginAssemblyLoader Loader;
private readonly JsonDocument HostConfig;
private readonly ILogProvider? Log;