コード例 #1
0
        public async Task RefreshAsync()
        {
            var refreshTime = DateTimeOffset.UtcNow;
            var latestFlags = await _storage.GetAsync();

            _latestFlags = new FeatureFlagsAndRefreshTime(latestFlags, refreshTime);
        }
コード例 #2
0
        public FeatureFlagCacheService(
            IFeatureFlagStorageService storage,
            FeatureFlagOptions options,
            IFeatureFlagTelemetryService telemetryService,
            ILogger <FeatureFlagCacheService> logger)
        {
            _storage = storage ?? throw new ArgumentNullException(nameof(storage));
            _options = options ?? throw new ArgumentNullException(nameof(options));
            _logger  = logger ?? throw new ArgumentNullException(nameof(logger));

            _telemetryServiceOrNull = telemetryService;
            _latestFlags            = null;
        }