Ejemplo n.º 1
0
        private async Task Poll()
        {
            var services = await ConsulDiscoveryService.GetAsync(Option.Service);

            if (services == null)
            {
                services = new List <MicroService>();
            }

            var key = GetCacheKey();
            await ServiceCache.SetAsync(key, services, new DistributedCacheEntryOptions()
            {
                AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(Option.Expires)
            });
        }