public void Process(WatchedEvent @event) { if (string.IsNullOrEmpty(@event.Path)) { return; } var baseUrl = @event.Path.Split('/')[3]; switch (@event.Type) { case EventType.NodeDataChanged: { var d = node.GetCrawlerConfig(baseUrl); CrawlerServerManager.Instance.AddServer(baseUrl, d.Ips); break; } case EventType.NodeDeleted: { break; } } }
public override Task process(WatchedEvent @event) { if (string.IsNullOrEmpty(@event.getPath())) { return(Task.CompletedTask); } var baseUrl = @event.getPath().Split('/')[3]; switch (@event.get_Type()) { case EventType.NodeDataChanged: { var d = node.GetCrawlerConfig(baseUrl); CrawlerServerManager.Instance.AddServer(baseUrl, d.Ips); break; } case EventType.NodeDeleted: { break; } } return(Task.CompletedTask); }