Skip to content

Commit

Permalink
🐛 Fix RemoveByPrefixAsync for Redis Caching Provider.
Browse files Browse the repository at this point in the history
  • Loading branch information
catcherwong committed Feb 2, 2018
1 parent fdc615c commit 4da5dfb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/EasyCaching.Redis/DefaultRedisCachingProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public void RemoveByPrefix(string prefix)
{
ArgumentCheck.NotNullOrWhiteSpace(prefix, nameof(prefix));

this.HandlePrefix(prefix);
prefix = this.HandlePrefix(prefix);

foreach (var server in _servers)
{
Expand Down Expand Up @@ -361,9 +361,15 @@ private async Task HandleKeyDelWithTranAsync(IServer server, string prefix)
{
var tran = _cache.CreateTransaction();

await tran.KeyDeleteAsync(keys.ToArray());
Task delTask = tran.KeyDeleteAsync(keys.ToArray());

Task execTask = tran.ExecuteAsync(CommandFlags.FireAndForget);

await Task.WhenAll(delTask, execTask);

//await tran.KeyDeleteAsync(keys.ToArray());

await tran.ExecuteAsync(CommandFlags.FireAndForget);
//await tran.ExecuteAsync(CommandFlags.FireAndForget);
}
}
while (count <= 0);
Expand Down

0 comments on commit 4da5dfb

Please sign in to comment.