Expiration is not working in Couchbase server

.net

#1

I am using the below code

public async Task Set(IDictionary<string, T> items, TimeSpan validFor)
{
var result = _bucket.Upsert(items);
foreach (var item in result)
{
await TouchAsync(item.Key, validFor);
}
return result.Count == items.Count;
}

public async Task TouchAsync(string key, TimeSpan expiration)
{
var result = await _bucket.TouchAsync(key, expiration);
return result.Success;
}


#2

Can you say more about what you expect to happen and what you are observing?


#3

I have set the expiration is 2 mints.

if i use TouchAsync it is not working means not expiring after 2 mitns.
if i use Touch it is working fine. But i want to use TouchAsync only.


#4

@balaji.j -

It sounds like you are saying that the async version of Touch may have a bug where it’s not expiring at the same time as the non-async version?

Would you mind telling us:

  • The Couchbase Server version you are using?

  • The Couchbase .NET SDK you are using?

  • The bucket type: Couchbase or Memcached?

  • The result of await TouchAsync(item.Key, validFor)? The method will return an OperationResult and the Status, Message and Exception fields should help us.

Thanks,

-Jeff