private async Task StartAsync( Application.IQueryable <MongoService, Service> queryableServices, IRegisterable <Service> registerableService, HttpClient client) { while (true) { var registeredServices = await queryableServices.Query(_ => true); foreach (var s in registeredServices) { var updatedService = new Service( s.Id, s.Name, s.DocumentationUrl, s.StatusUrl, await new HeartbeatableService(s, client).Status ); await registerableService.Register(updatedService); } await Task.Delay(TimeSpan.FromMinutes(5)); } }
public async Task <ActionResult> Get() { return(Ok(await _findableService.Query(_ => true))); }