private void OnChangedLocationData(object source, FileSystemEventArgs e) { try { builder.LoadLocationData(); Logger.Debug("updated location data file"); } catch (Exception ex) { Logger.Debug(ex, "location data file locked, cannot load"); } }
private void OnChangedLocationData(object source, FileSystemEventArgs e) { if (!AdmConfigBuilder.IsFileLocked(new FileInfo(configBuilder.LocationDataPath))) { try { configBuilder.LoadLocationData(); Logger.Debug("updated location data file"); } catch (Exception ex) { Logger.Debug(ex, "location data file locked, cannot load"); } } }
private void OnChangedLocationData(object source, FileSystemEventArgs e) { if (DateTime.Now.Subtract(lastTimeLocationConfigChanged).TotalMilliseconds < 20) { return; } lastTimeLocationConfigChanged = DateTime.Now; if (!AdmConfigBuilder.IsFileLocked(new FileInfo(builder.LocationDataPath))) { try { builder.LoadLocationData(); Logger.Debug("updated location data file"); } catch (Exception ex) { Logger.Debug(ex, "location data file locked, cannot load"); } } }