Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MemcachedClient.Remove - differentiate between item not found and other errors. #118

Open
amritaGoel opened this issue May 31, 2019 · 1 comment

Comments

@amritaGoel
Copy link

Hi

I am using MemcachedClient.Remove function. It returns "true if the item was successfully removed from the cache; false otherwise." Is there a way to differentiate if it returned false because the item was not found or because of some other failure(Other than doing a lookup after remove). I would like to handle both cases differently in my code. In case of some other reason for failure, I would want to retry removing the item.

Thanks

@cnblogs-dudu
Copy link

Update EnyimMemcachedCore to 2.2.4 and use the following code.

var result = await ((IMemcachedResultsClient)_memcachedClient).ExecuteRemoveAsync(CacheKey);
if (result.StatusCode == -1)
{
    //....
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants