public void AcquireDistributedLock_MultiStorage() { UseConnection(connection => { var SecondStorage = new RedisStorage(Redis.ServerInfo, new RedisStorageOptions() { Db = Redis.Storage.Db }); using (var lock1 = connection.AcquireDistributedLock("some-hash:lock", TimeSpan.FromSeconds(1))) { Assert.Throws<TimeoutException>(() => { var lock2 = SecondStorage.GetConnection().AcquireDistributedLock("some-hash:lock", TimeSpan.FromMilliseconds(10)); }); } }); }
public void AcquireDistributedLock_MultiStorage() { UseConnection(connection => { var SecondStorage = new RedisStorage(Redis.ServerInfo, new RedisStorageOptions() { Db = Redis.Storage.Db }); using (var lock1 = connection.AcquireDistributedLock("some-hash:lock", TimeSpan.FromSeconds(1))) { Assert.Throws <TimeoutException>(() => { var lock2 = SecondStorage.GetConnection().AcquireDistributedLock("some-hash:lock", TimeSpan.FromMilliseconds(10)); }); } }); }