Skip to content

MemcachedClient.Remove fails to remove items from cache #64

@Gonyoda

Description

@Gonyoda

EnyimMemcachedCore v2.1.8

ExecuteRemoveAsync doesn't hash the key before determine the pool node. Therefore, the remove always fails.

public async Task<IRemoveOperationResult> ExecuteRemoveAsync(string key)
    {
      IMemcachedNode memcachedNode = this.pool.Locate(key);

should be:

public async Task<IRemoveOperationResult> ExecuteRemoveAsync(string key)
    {
      string hashedKey = this.keyTransformer.Transform(key); 
      IMemcachedNode memcachedNode = this.pool.Locate(hashedKey );

And similar for the non-async version. And, hashedKey needs to be passed to OperationFactory.Delete later in the method(s).

The key is hashed in the PerformStoreAsync and PerformTryGet.

I'd make a PR to help out, but I'm not sure which branch to work off.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions