Beispiel #1
0
        public async Task StartMonitoring(StartMonitoringModel startMonitoringModel)
        {
            var newId = _idGenerator.Generate();
            await _siteStorage.AddSiteInfo(newId, startMonitoringModel.Uri, startMonitoringModel.RefreshTimeInSeconds);

            await _trackingTimer.Start(newId, startMonitoringModel.Uri, startMonitoringModel.RefreshTimeInSeconds);

            await _clientNotifier.UpdateSitesInfo();
        }
Beispiel #2
0
        public async Task StartTracking()
        {
            await _siteStorage.ResetAllStatuses();

            var sites = await _siteStorage.GetSitesInfo();

            var tasks = sites.Select(x => _trackingTimer.Start(x.Id, x.Uri, x.RefreshTimeInSeconds));
            await Task.WhenAll(tasks);
        }