Example #1
0
 private void OnTick(object state)
 {
     using (var scope = _factory.CreateScope())
     {
         _logger.LogDebug("Cache invalidation started");
         _cacheTagWatcher.TrackChanges(scope.ServiceProvider);
         _logger.LogDebug("Cache invalidation completed");
     }
 }
 public Task Invoke(HttpContext context, ICacheTagWatcher cacheTagWatcher)
 {
     if (!Regex.IsMatch(context.Request.Path, _excludePathRegex))
     {
         cacheTagWatcher.TrackChanges(context.RequestServices);
     }
     // Call the next delegate/middleware in the pipeline
     return(_next(context));
 }