Skip to content

Commit 8afd725

Browse files
committed
Fixed typos
1 parent fddf66c commit 8afd725

16 files changed

+62
-62
lines changed

StackExRedis/NHibernate.Caches.StackExRedis.Tests/Async/RedisCacheDefaultStrategyFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public async Task TestMaxAllowedVersionAsync()
3737

3838
await (cache.ClearAsync(CancellationToken.None));
3939

40-
Assert.That(strategy.CurrentVersion, Is.EqualTo(1L), "The version was not reset to 1");
40+
Assert.That(strategy.CurrentVersion, Is.EqualTo(1L), "the version was not reset to 1");
4141
}
4242

4343
[Test]

StackExRedis/NHibernate.Caches.StackExRedis.Tests/Async/RedisCacheFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public async Task TestLockUnlockManyAsync()
146146
// Test partial locks by locking the first 5 keys and afterwards try to lock last 6 keys.
147147
var lockValue = await (cache.LockManyAsync(keys.Take(5).ToArray(), CancellationToken.None));
148148

149-
Assert.ThrowsAsync<CacheException>(() => cache.LockManyAsync(keys.Skip(4).ToArray(), CancellationToken.None), "The fifth key should be locked");
149+
Assert.ThrowsAsync<CacheException>(() => cache.LockManyAsync(keys.Skip(4).ToArray(), CancellationToken.None), "the fifth key should be locked");
150150

151151
Assert.DoesNotThrowAsync(async () =>
152152
{

StackExRedis/NHibernate.Caches.StackExRedis.Tests/RedisCacheDefaultStrategyFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public void TestNoExpiration()
1919
var props = GetDefaultProperties();
2020
props["expiration"] = "0";
2121
Assert.Throws<CacheException>(() => DefaultProvider.BuildCache(DefaultRegion, props),
22-
"Default region strategy should not allow to have no expiration");
22+
"default region strategy should not allow to have no expiration");
2323
}
2424

2525
[Test]
@@ -36,7 +36,7 @@ public void TestMaxAllowedVersion()
3636

3737
cache.Clear();
3838

39-
Assert.That(strategy.CurrentVersion, Is.EqualTo(1L), "The version was not reset to 1");
39+
Assert.That(strategy.CurrentVersion, Is.EqualTo(1L), "the version was not reset to 1");
4040
}
4141

4242
[Test]

StackExRedis/NHibernate.Caches.StackExRedis.Tests/RedisCacheFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public void TestLockUnlockMany()
143143
// Test partial locks by locking the first 5 keys and afterwards try to lock last 6 keys.
144144
var lockValue = cache.LockMany(keys.Take(5).ToArray());
145145

146-
Assert.Throws<CacheException>(() => cache.LockMany(keys.Skip(4).ToArray()), "The fifth key should be locked");
146+
Assert.Throws<CacheException>(() => cache.LockMany(keys.Skip(4).ToArray()), "the fifth key should be locked");
147147

148148
Assert.DoesNotThrow(() =>
149149
{

StackExRedis/NHibernate.Caches.StackExRedis.Tests/RedisCacheProviderFixture.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ public void TestExpiration()
3030

3131
var strategy = cache.RegionStrategy;
3232
Assert.That(strategy, Is.Not.Null, "strategy was not set for the pre-configured foo cache");
33-
Assert.That(strategy, Is.TypeOf<DefaultRegionStrategy>(), "Unexpected strategy type for foo region");
34-
Assert.That(strategy.Expiration, Is.EqualTo(TimeSpan.FromSeconds(500)), "Unexpected expiration value for foo region");
33+
Assert.That(strategy, Is.TypeOf<DefaultRegionStrategy>(), "unexpected strategy type for foo region");
34+
Assert.That(strategy.Expiration, Is.EqualTo(TimeSpan.FromSeconds(500)), "unexpected expiration value for foo region");
3535

3636
cache = (RedisCache) DefaultProvider.BuildCache("noExplicitExpiration", null);
3737
Assert.That(cache.RegionStrategy.Expiration, Is.EqualTo(TimeSpan.FromSeconds(300)),
38-
"Unexpected expiration value for noExplicitExpiration region");
39-
Assert.That(cache.RegionStrategy.UseSlidingExpiration, Is.True, "Unexpected sliding value for noExplicitExpiration region");
38+
"unexpected expiration value for noExplicitExpiration region");
39+
Assert.That(cache.RegionStrategy.UseSlidingExpiration, Is.True, "unexpected sliding value for noExplicitExpiration region");
4040

4141
cache = (RedisCache) DefaultProvider
4242
.BuildCache("noExplicitExpiration", new Dictionary<string, string> { { "expiration", "100" } });
4343
Assert.That(cache.RegionStrategy.Expiration, Is.EqualTo(TimeSpan.FromSeconds(100)),
44-
"Unexpected expiration value for noExplicitExpiration region with default expiration");
44+
"unexpected expiration value for noExplicitExpiration region with default expiration");
4545

4646
cache = (RedisCache) DefaultProvider
4747
.BuildCache("noExplicitExpiration", new Dictionary<string, string> { { Cfg.Environment.CacheDefaultExpiration, "50" } });
4848
Assert.That(cache.RegionStrategy.Expiration, Is.EqualTo(TimeSpan.FromSeconds(50)),
49-
"Unexpected expiration value for noExplicitExpiration region with cache.default_expiration");
49+
"unexpected expiration value for noExplicitExpiration region with cache.default_expiration");
5050
}
5151

5252
}

StackExRedis/NHibernate.Caches.StackExRedis/AbstractRegionStrategy.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public abstract partial class AbstractRegionStrategy
4747
/// even if an exception occurs which we are also abusing in order to avoid having a special mechanism to
4848
/// clear the dictionary in order to prevent memory leaks.
4949
/// </summary>
50-
private readonly ConcurrentDictionary<string, string> _aquiredKeyLocks = new ConcurrentDictionary<string, string>();
50+
private readonly ConcurrentDictionary<string, string> _acquiredKeyLocks = new ConcurrentDictionary<string, string>();
5151

5252

5353
/// <summary>
@@ -150,7 +150,7 @@ protected AbstractRegionStrategy(ConnectionMultiplexer connectionMultiplexer,
150150
public bool ExpirationEnabled => Expiration != TimeSpan.Zero;
151151

152152
/// <summary>
153-
/// The timeout of an aquired lock.
153+
/// The timeout of an acquired lock.
154154
/// </summary>
155155
public TimeSpan LockTimeout { get; }
156156

@@ -372,7 +372,7 @@ public virtual string Lock(object key)
372372
var cacheKey = GetCacheKey(key);
373373
var lockValue = _keyLocker.Lock(cacheKey, LockScript, GetAdditionalKeys(), GetAdditionalValues());
374374

375-
_aquiredKeyLocks.AddOrUpdate(cacheKey, _ => lockValue, (_, currValue) =>
375+
_acquiredKeyLocks.AddOrUpdate(cacheKey, _ => lockValue, (_, currValue) =>
376376
{
377377
Log.Warn(
378378
$"Calling {nameof(Lock)} method for key:'{cacheKey}' that was already locked. " +
@@ -419,7 +419,7 @@ public virtual bool Unlock(object key)
419419
}
420420
var cacheKey = GetCacheKey(key);
421421

422-
if (!_aquiredKeyLocks.TryRemove(cacheKey, out var lockValue))
422+
if (!_acquiredKeyLocks.TryRemove(cacheKey, out var lockValue))
423423
{
424424
Log.Warn(
425425
$"Calling {nameof(Unlock)} method for key:'{cacheKey}' that was not locked with {nameof(Lock)} method before.");

StackExRedis/NHibernate.Caches.StackExRedis/Async/AbstractRegionStrategy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ async Task<string> InternalLockAsync()
300300
var cacheKey = GetCacheKey(key);
301301
var lockValue = await (_keyLocker.LockAsync(cacheKey, LockScript, GetAdditionalKeys(), GetAdditionalValues(), cancellationToken)).ConfigureAwait(false);
302302

303-
_aquiredKeyLocks.AddOrUpdate(cacheKey, _ => lockValue, (_, currValue) =>
303+
_acquiredKeyLocks.AddOrUpdate(cacheKey, _ => lockValue, (_, currValue) =>
304304
{
305305
Log.Warn(
306306
$"Calling {nameof(LockAsync)} method for key:'{cacheKey}' that was already locked. " +
@@ -367,7 +367,7 @@ public virtual Task<bool> UnlockAsync(object key, CancellationToken cancellation
367367
{
368368
var cacheKey = GetCacheKey(key);
369369

370-
if (!_aquiredKeyLocks.TryRemove(cacheKey, out var lockValue))
370+
if (!_acquiredKeyLocks.TryRemove(cacheKey, out var lockValue))
371371
{
372372
Log.Warn(
373373
$"Calling {nameof(UnlockAsync)} method for key:'{cacheKey}' that was not locked with {nameof(LockAsync)} method before.");

StackExRedis/NHibernate.Caches.StackExRedis/Async/DefaultRegionStrategy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public override async Task<bool> UnlockAsync(object key, CancellationToken cance
164164
{
165165
cancellationToken.ThrowIfCancellationRequested();
166166
await (InitializeVersionAsync()).ConfigureAwait(false);
167-
// If the lock was aquired in the old version we are unable to unlock the key.
167+
// If the lock was acquired in the old version we are unable to unlock the key.
168168
return false;
169169
}
170170
}
@@ -181,7 +181,7 @@ public override async Task<int> UnlockManyAsync(object[] keys, string lockValue,
181181
{
182182
cancellationToken.ThrowIfCancellationRequested();
183183
await (InitializeVersionAsync()).ConfigureAwait(false);
184-
// If the lock was aquired in the old version we are unable to unlock the keys.
184+
// If the lock was acquired in the old version we are unable to unlock the keys.
185185
return 0;
186186
}
187187
}

StackExRedis/NHibernate.Caches.StackExRedis/Async/RedisKeyLocker.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal partial class RedisKeyLocker
3030
/// <param name="extraValues">The extra values that will be provided to the <paramref name="luaScript"/></param>
3131
/// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
3232
/// <returns>The lock value used to lock the key.</returns>
33-
/// <exception cref="CacheException">Thrown if the lock was not aquired.</exception>
33+
/// <exception cref="CacheException">Thrown if the lock was not acquired.</exception>
3434
public Task<string> LockAsync(string key, string luaScript, RedisKey[] extraKeys, RedisValue[] extraValues, CancellationToken cancellationToken)
3535
{
3636
if (key == null)
@@ -44,7 +44,7 @@ public Task<string> LockAsync(string key, string luaScript, RedisKey[] extraKeys
4444
return InternalLockAsync();
4545
async Task<string> InternalLockAsync()
4646
{
47-
var lockKey = $"{key}{_lockKeyPostfix}";
47+
var lockKey = $"{key}{_lockKeySuffix}";
4848
var totalAttempts = 0;
4949
var lockTimer = new Stopwatch();
5050
lockTimer.Restart();
@@ -81,7 +81,7 @@ async Task<string> InternalLockAsync()
8181
}
8282
totalAttempts++;
8383

84-
} while (_retryTimes > totalAttempts - 1 && lockTimer.ElapsedMilliseconds < _aquireLockTimeout);
84+
} while (_retryTimes > totalAttempts - 1 && lockTimer.ElapsedMilliseconds < _acquireLockTimeout);
8585

8686
throw new CacheException("Unable to acquire cache lock: " +
8787
$"region='{_regionName}', " +
@@ -100,7 +100,7 @@ async Task<string> InternalLockAsync()
100100
/// <param name="extraValues">The extra values that will be provided to the <paramref name="luaScript"/></param>
101101
/// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
102102
/// <returns>The lock value used to lock the keys.</returns>
103-
/// <exception cref="CacheException">Thrown if the lock was not aquired.</exception>
103+
/// <exception cref="CacheException">Thrown if the lock was not acquired.</exception>
104104
public Task<string> LockManyAsync(string[] keys, string luaScript, RedisKey[] extraKeys, RedisValue[] extraValues, CancellationToken cancellationToken)
105105
{
106106
if (keys == null)
@@ -122,7 +122,7 @@ async Task<string> InternalLockManyAsync()
122122
var lockKeys = new RedisKey[keys.Length];
123123
for (var i = 0; i < keys.Length; i++)
124124
{
125-
lockKeys[i] = $"{keys[i]}{_lockKeyPostfix}";
125+
lockKeys[i] = $"{keys[i]}{_lockKeySuffix}";
126126
}
127127
var totalAttempts = 0;
128128
var lockTimer = new Stopwatch();
@@ -152,7 +152,7 @@ async Task<string> InternalLockManyAsync()
152152
}
153153
totalAttempts++;
154154

155-
} while (_retryTimes > totalAttempts - 1 && lockTimer.ElapsedMilliseconds < _aquireLockTimeout);
155+
} while (_retryTimes > totalAttempts - 1 && lockTimer.ElapsedMilliseconds < _acquireLockTimeout);
156156

157157
throw new CacheException("Unable to acquire cache lock: " +
158158
$"region='{_regionName}', " +
@@ -185,7 +185,7 @@ public Task<bool> UnlockAsync(string key, string lockValue, string luaScript, Re
185185
return InternalUnlockAsync();
186186
async Task<bool> InternalUnlockAsync()
187187
{
188-
var lockKey = $"{key}{_lockKeyPostfix}";
188+
var lockKey = $"{key}{_lockKeySuffix}";
189189
if (string.IsNullOrEmpty(luaScript))
190190
{
191191
cancellationToken.ThrowIfCancellationRequested();
@@ -239,7 +239,7 @@ async Task<int> InternalUnlockManyAsync()
239239
var lockKeys = new RedisKey[keys.Length];
240240
for (var i = 0; i < keys.Length; i++)
241241
{
242-
lockKeys[i] = $"{keys[i]}{_lockKeyPostfix}";
242+
lockKeys[i] = $"{keys[i]}{_lockKeySuffix}";
243243
}
244244
if (extraKeys != null)
245245
{

StackExRedis/NHibernate.Caches.StackExRedis/ConfigurationHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static System.Type GetSystemType(string key, IDictionary<string, string>
7373
}
7474
catch (Exception e)
7575
{
76-
throw new CacheException($"Unable to aquire type '{typeName}' from the configuration property '{key}'", e);
76+
throw new CacheException($"Unable to acquire type '{typeName}' from the configuration property '{key}'", e);
7777
}
7878
}
7979

0 commit comments

Comments
 (0)