Ejemplo n.º 1
0
 public Task RefreshAsync(string key, CancellationToken token = default(CancellationToken))
 {
     if (DisableRefreshAsync)
     {
         throw new InvalidOperationException();
     }
     return(_cache.RefreshAsync(key));
 }
Ejemplo n.º 2
0
 public Task RefreshAsync(string key)
 {
     if (DisableRefreshAsync)
     {
         throw new InvalidOperationException();
     }
     return(_cache.RefreshAsync(key));
 }
Ejemplo n.º 3
0
 public Task RefreshAsync(string key, CancellationToken token = default)
 {
     if (DisableRefreshAsync)
     {
         throw new InvalidOperationException();
     }
     if (DelayRefreshAsync)
     {
         token.WaitHandle.WaitOne(TimeSpan.FromSeconds(10));
         token.ThrowIfCancellationRequested();
     }
     return(_cache.RefreshAsync(key));
 }