From da54dadf2578c90c9deee7e1fc108a59187ebc00 Mon Sep 17 00:00:00 2001 From: Clemens Vasters Date: Wed, 4 Sep 2024 19:30:46 +0200 Subject: [PATCH] Don't watch "deleted" events --- src/Microsoft.Azure.Relay.Bridge/Configuration/Config.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Microsoft.Azure.Relay.Bridge/Configuration/Config.cs b/src/Microsoft.Azure.Relay.Bridge/Configuration/Config.cs index 24b9780..005f351 100644 --- a/src/Microsoft.Azure.Relay.Bridge/Configuration/Config.cs +++ b/src/Microsoft.Azure.Relay.Bridge/Configuration/Config.cs @@ -484,7 +484,6 @@ public static Config LoadConfig(CommandLineSettings commandLineSettings) { var fsw = new FileSystemWatcher(Path.GetDirectoryName(machineConfigFileName), Path.GetFileName(machineConfigFileName)); fsw.Created += (o, e) => onchange(); - fsw.Deleted += (o, e) => onchange(); fsw.Changed += (o, e) => onchange(); fsw.EnableRaisingEvents = true; config.fileSystemWatchers.Add(fsw); @@ -504,7 +503,6 @@ public static Config LoadConfig(CommandLineSettings commandLineSettings) { var fsw = new FileSystemWatcher(Path.GetDirectoryName(userConfigFileName), Path.GetFileName(userConfigFileName)); fsw.Created += (o, e) => onchange(); - fsw.Deleted += (o, e) => onchange(); fsw.Changed += (o, e) => onchange(); fsw.EnableRaisingEvents = true; config.fileSystemWatchers.Add(fsw); @@ -518,7 +516,6 @@ public static Config LoadConfig(CommandLineSettings commandLineSettings) { var fsw = new FileSystemWatcher(Path.GetDirectoryName(commandLineSettings.ConfigFile), Path.GetFileName(commandLineSettings.ConfigFile)); fsw.Created += (o, e) => onchange(); - fsw.Deleted += (o, e) => onchange(); fsw.Changed += (o, e) => onchange(); fsw.EnableRaisingEvents = true; config.fileSystemWatchers.Add(fsw);