• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ThreeMammals / Ocelot / 20926763792

12 Jan 2026 04:23PM UTC coverage: 93.397% (-0.1%) from 93.503%
20926763792

Pull #1183

github

web-flow
Merge 94e251d0b into 9fc4e78d3
Pull Request #1183: #651 Merge custom JSON properties across multiple `ocelot.X.json` configuration files using Newtonsoft's `JToken` merge functionality

6549 of 7012 relevant lines covered (93.4%)

2996.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
src/Ocelot/Configuration/Repository/ConsulFileConfigurationPollerOption.cs
1
namespace Ocelot.Configuration.Repository;
2

3
public class ConsulFileConfigurationPollerOption : IFileConfigurationPollerOptions
4
{
5
    private readonly IInternalConfigurationRepository _internalConfigRepo;
6
    private readonly IFileConfigurationRepository _fileConfigurationRepository;
7

8
    public ConsulFileConfigurationPollerOption(IInternalConfigurationRepository internalConfigurationRepository,
×
9
                                               IFileConfigurationRepository fileConfigurationRepository)
×
10
    {
11
        _internalConfigRepo = internalConfigurationRepository;
×
12
        _fileConfigurationRepository = fileConfigurationRepository;
×
13
    }
×
14

15
        public int Delay => GetDelay().GetAwaiter().GetResult();
×
16

17
        private async Task<int> GetDelay()
18
        {
19
            var delay = 1000;
×
20
            try
21
            {
22
                var fileConfig = await _fileConfigurationRepository.GetAsync();
×
23
                var provider = fileConfig?.GlobalConfiguration?.ServiceDiscoveryProvider;
×
24
                if (provider != null && provider.PollingInterval > 0)
×
25
                {
26
                    delay = provider.PollingInterval;
×
27
                }
28
                else
29
                {
30
                    var internalConfig = _internalConfigRepo.Get();
×
31
                    var configuration = internalConfig?.Data?.ServiceProviderConfiguration;
×
32
                    if (configuration != null && configuration.PollingInterval > 0)
×
33
                    {
34
                        delay = configuration.PollingInterval;
×
35
                    }
36
                }
37
            }
×
38
            catch
×
39
            {
40
                delay = 0;
×
41
            }
×
42

43
        return delay;
×
44
    }
×
45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc