Skip to content

Commit 98f2195

Browse files
author
John Gonyo
committed
use the key transformer in Delete operations
1 parent e76e5da commit 98f2195

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Enyim.Caching/MemcachedClient.Results.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,13 @@ public IConcatOperationResult ExecutePrepend(string key, ulong cas, ArraySegment
444444
/// <returns>true if the item was successfully removed from the cache; false otherwise.</returns>
445445
public IRemoveOperationResult ExecuteRemove(string key)
446446
{
447-
//var hashedKey = this.keyTransformer.Transform(key);
448-
var node = this.pool.Locate(key);
447+
var hashedKey = this.keyTransformer.Transform(key);
448+
var node = this.pool.Locate(hashedKey);
449449
var result = RemoveOperationResultFactory.Create();
450450

451451
if (node != null)
452452
{
453-
var command = this.pool.OperationFactory.Delete(key, 0);
453+
var command = this.pool.OperationFactory.Delete(hashedKey, 0);
454454
var commandResult = node.Execute(command);
455455

456456
if (commandResult.Success)
@@ -472,12 +472,13 @@ public IRemoveOperationResult ExecuteRemove(string key)
472472

473473
public async Task<IRemoveOperationResult> ExecuteRemoveAsync(string key)
474474
{
475-
var node = this.pool.Locate(key);
475+
var hashedKey = this.keyTransformer.Transform(key);
476+
var node = this.pool.Locate(hashedKey);
476477
var result = RemoveOperationResultFactory.Create();
477478

478479
if (node != null)
479480
{
480-
var command = this.pool.OperationFactory.Delete(key, 0);
481+
var command = this.pool.OperationFactory.Delete(hashedKey, 0);
481482
var commandResult = await node.ExecuteAsync(command);
482483

483484
if (commandResult.Success)

0 commit comments

Comments
 (0)