public void AddConnected() { _lock.Wait(); try { _numConnected++; if (!DashboardScrape.IsTaskActive) { _cancellationTokenSource = new CancellationTokenSource(); DashboardScrape.StartDashboardScrapeTask(_settings.Url, _settings.DashboardRefreshTime, _cancellationTokenSource.Token); } } finally { _lock.Release(); } }
public override Task OnConnectedAsync() { DashboardScrape.StartDashboardScrapeTask(_settings.Url, _settings.DashboardRefreshTime, Context.ConnectionId, DataGatheredEvent, ScrapeSavedEvent); return(base.OnConnectedAsync()); }