Başar OLGUN
Başar OLGUN

Reputation: 13

servicestack Redis Client AcquireLock TTL has no affect

We are having problem with ServiceStack Redis Client that TTL property is not working as we expect. When we browse redis desktop manager we see that our lock key has no TTL value set.

Do you have any recommendation ?

Here is the sample code as recommended:

using (var redisManager = new PooledRedisClientManager(dbindex, redisUri))
using (var redisClient = redisManager.GetClient())
{
  return redisClient.AcquireLock("locks:" + key, new TimeSpan(0,1,0));
}

Upvotes: 1

Views: 561

Answers (1)

mythz
mythz

Reputation: 143319

The Timeout is used within the content of the lock string to calculate an expired lock, i.e. it doesn't change the TTL of the lock key.

Upvotes: 1

Related Questions