mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-20 20:12:57 +00:00
Improved hot reloading
This commit is contained in:
parent
e82d1e473f
commit
62036a82be
@ -16,10 +16,21 @@ public static partial class PluginFactory
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
HOT_RELOAD_WATCHER.IncludeSubdirectories = true;
|
HOT_RELOAD_WATCHER.IncludeSubdirectories = true;
|
||||||
HOT_RELOAD_WATCHER.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName;
|
HOT_RELOAD_WATCHER.NotifyFilter = NotifyFilters.CreationTime
|
||||||
HOT_RELOAD_WATCHER.Filter = "*.lua";
|
| NotifyFilters.DirectoryName
|
||||||
|
| NotifyFilters.FileName
|
||||||
|
| NotifyFilters.LastAccess
|
||||||
|
| NotifyFilters.LastWrite
|
||||||
|
| NotifyFilters.Size;
|
||||||
|
|
||||||
HOT_RELOAD_WATCHER.Changed += HotReloadEventHandler;
|
HOT_RELOAD_WATCHER.Changed += HotReloadEventHandler;
|
||||||
HOT_RELOAD_WATCHER.Deleted += HotReloadEventHandler;
|
HOT_RELOAD_WATCHER.Deleted += HotReloadEventHandler;
|
||||||
|
HOT_RELOAD_WATCHER.Created += HotReloadEventHandler;
|
||||||
|
HOT_RELOAD_WATCHER.Renamed += HotReloadEventHandler;
|
||||||
|
HOT_RELOAD_WATCHER.Error += (_, args) =>
|
||||||
|
{
|
||||||
|
LOG.LogError(args.GetException(), "Error in hot reload watcher.");
|
||||||
|
};
|
||||||
HOT_RELOAD_WATCHER.EnableRaisingEvents = true;
|
HOT_RELOAD_WATCHER.EnableRaisingEvents = true;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
Loading…
Reference in New Issue
Block a user