Skip to content

Commit

Permalink
#1703 RedisCacheManager doesn't work properly when using database num…
Browse files Browse the repository at this point in the history
…ber greater then 0
  • Loading branch information
AndreiMaz committed Aug 26, 2016
1 parent e06a3e9 commit 80102dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Libraries/Nop.Core/Caching/RedisCacheManager.cs
Expand Up @@ -132,9 +132,9 @@ public virtual void RemoveByPattern(string pattern)
foreach (var ep in _connectionWrapper.GetEndpoints())
{
var server = _connectionWrapper.Server(ep);
var keys = server.Keys(pattern: "*" + pattern + "*");
var keys = server.Keys(database: _db.Database, pattern: "*" + pattern + "*");
foreach (var key in keys)
_db.KeyDelete(key);
Remove(key);
}
}

Expand All @@ -151,9 +151,9 @@ public virtual void Clear()
//server.FlushDatabase();

//that's why we simply interate through all elements now
var keys = server.Keys();
var keys = server.Keys(database: _db.Database);
foreach (var key in keys)
_db.KeyDelete(key);
Remove(key);
}
}

Expand Down

0 comments on commit 80102dc

Please sign in to comment.