Example #1
0
        public async Task Execute(IJobExecutionContext context)
        {
            var enabledAgents = _agentsRepository.GetRegistered().Where(item => item.IsEnabled);

            foreach (var agent in enabledAgents)
            {
                await SyncronizeMetricsFromAgent(agent);
            }
        }
            public async Task <AgentInfoResponse> Handle(GetRegisteredAgentsQuery request, CancellationToken cancellationToken)
            {
                var result = await Task.Run(() =>
                {
                    var agentsList = _repository.GetRegistered();

                    var response = new AgentInfoResponse();

                    response.Agents.AddRange(_mapper.Map <List <AgentInfoDto> >(agentsList));

                    return(response);
                });

                return(result);
            }