diff --git a/src/CacheManager.Core/BaseCacheManager.cs b/src/CacheManager.Core/BaseCacheManager.cs index 39fb48f0..ed262c4b 100644 --- a/src/CacheManager.Core/BaseCacheManager.cs +++ b/src/CacheManager.Core/BaseCacheManager.cs @@ -100,7 +100,7 @@ private BaseCacheManager(string name, ICacheManagerConfiguration configuration, handle.OnCacheSpecificRemove += (sender, args) => { // added sync for using backplane with in-memory caches on cache specific removal - // but commented for now, this is not really needed if all instances use the same expiration etc, would just cause dublicated events + // but commented for now, this is not really needed if all instances use the same expiration etc, would just cause duplicated events ////if (_cacheBackplane != null && handle.Configuration.IsBackplaneSource && !handle.IsDistributedCache) ////{ //// if (string.IsNullOrEmpty(args.Region)) @@ -125,7 +125,7 @@ private BaseCacheManager(string name, ICacheManagerConfiguration configuration, EvictFromHandlesAbove(args.Key, args.Region, handleIndex); } - // moving down below cleanup, optherwise the item could still be in memory + // moving down below cleanup, otherwise the item could still be in memory TriggerOnRemoveByHandle(args.Key, args.Region, args.Reason, handleIndex + 1, args.Value); }; @@ -733,16 +733,16 @@ private void RegisterCacheBackplane(CacheBackplane backplane) if (_cacheHandles.Any(p => p.Configuration.IsBackplaneSource)) { // added includeSource param to get the handles which need to be synced. - // in case the backplane source is non-distributed (in-memory), only remotly triggered remove and clear should also - // trigger a sync locally. For distribtued caches, we expect that the distributed cache is already the source and in sync - // as that's the layer which triggered the event. In this case, only other in-memory handles above the distribtued, would be synced. - var handles = new Func[]>((includSource) => + // in case the backplane source is non-distributed (in-memory), only remotely triggered remove and clear should also + // trigger a sync locally. For distributed caches, we expect that the distributed cache is already the source and in sync + // as that's the layer which triggered the event. In this case, only other in-memory handles above the distributed, would be synced. + var handles = new Func[]>((includeSource) => { var handleList = new List>(); foreach (var handle in _cacheHandles) { if (!handle.Configuration.IsBackplaneSource || - (includSource && handle.Configuration.IsBackplaneSource && !handle.IsDistributedCache)) + (includeSource && handle.Configuration.IsBackplaneSource && !handle.IsDistributedCache)) { handleList.Add(handle); } diff --git a/src/CacheManager.Core/ExpirationMode.cs b/src/CacheManager.Core/ExpirationMode.cs index c7b46146..e05c2ca9 100644 --- a/src/CacheManager.Core/ExpirationMode.cs +++ b/src/CacheManager.Core/ExpirationMode.cs @@ -7,7 +7,7 @@ public enum ExpirationMode { /// - /// Default value for the expircation mode enum. + /// Default value for the expiration mode enum. /// CacheManager will default to None. The Default entry in the enum is used as separation from the other values /// and to make it possible to explicitly set the expiration to None. /// @@ -28,4 +28,4 @@ public enum ExpirationMode /// Absolute = 3 } -} \ No newline at end of file +} diff --git a/src/CacheManager.Core/ICacheManagerConfiguration.cs b/src/CacheManager.Core/ICacheManagerConfiguration.cs index e717a05b..241e9700 100644 --- a/src/CacheManager.Core/ICacheManagerConfiguration.cs +++ b/src/CacheManager.Core/ICacheManagerConfiguration.cs @@ -4,7 +4,7 @@ namespace CacheManager.Core { /// - /// The writable configuration contract used primarrily internal only + /// The writable configuration contract used primarily internal only /// public interface ICacheManagerConfiguration : IReadOnlyCacheManagerConfiguration { diff --git a/src/CacheManager.Core/Internal/BackplaneMessage.cs b/src/CacheManager.Core/Internal/BackplaneMessage.cs index e8dfd604..af5c3a86 100644 --- a/src/CacheManager.Core/Internal/BackplaneMessage.cs +++ b/src/CacheManager.Core/Internal/BackplaneMessage.cs @@ -529,7 +529,7 @@ public byte[] ReadBytes(int length) throw new IndexOutOfRangeException("Cannot read bytes, no additional bytes available."); } - // fix: length check before aloc + // fix: length check before alloc var result = new byte[length]; Buffer.BlockCopy(_data, pos - length, result, 0, length); return result; diff --git a/src/CacheManager.Core/Internal/CacheEventArgs.cs b/src/CacheManager.Core/Internal/CacheEventArgs.cs index 6366b629..ee442f40 100644 --- a/src/CacheManager.Core/Internal/CacheEventArgs.cs +++ b/src/CacheManager.Core/Internal/CacheEventArgs.cs @@ -132,7 +132,7 @@ public CacheActionEventArgs(string key, string region) /// /// The key. /// The region. - /// The origin the event occurred. If remote, the event got triggered by the backplane and was not actually excecuted locally. + /// The origin the event occurred. If remote, the event got triggered by the backplane and was not actually executed locally. /// If key is null. public CacheActionEventArgs(string key, string region, CacheActionEventArgOrigin origin) : this(key, region) @@ -153,7 +153,7 @@ public CacheActionEventArgs(string key, string region, CacheActionEventArgOrigin public string Region { get; } /// - /// Gets the event origin indicating if the event was triggered by a local action or remotly, through the backplane. + /// Gets the event origin indicating if the event was triggered by a local action or remotely, through the backplane. /// public CacheActionEventArgOrigin Origin { get; } = CacheActionEventArgOrigin.Local; @@ -172,14 +172,14 @@ public sealed class CacheClearEventArgs : EventArgs /// /// Initializes a new instance of the class. /// - /// The origin the event occurred. If remote, the event got triggered by the backplane and was not actually excecuted locally. + /// The origin the event occurred. If remote, the event got triggered by the backplane and was not actually executed locally. public CacheClearEventArgs(CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local) { Origin = origin; } /// - /// Gets the event origin indicating if the event was triggered by a local action or remotly, through the backplane. + /// Gets the event origin indicating if the event was triggered by a local action or remotely, through the backplane. /// public CacheActionEventArgOrigin Origin { get; } @@ -199,7 +199,7 @@ public sealed class CacheClearRegionEventArgs : EventArgs /// Initializes a new instance of the class. /// /// The region. - /// The origin the event occurred. If remote, the event got triggered by the backplane and was not actually excecuted locally. + /// The origin the event occurred. If remote, the event got triggered by the backplane and was not actually executed locally. /// If region is null. public CacheClearRegionEventArgs(string region, CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local) { @@ -216,7 +216,7 @@ public CacheClearRegionEventArgs(string region, CacheActionEventArgOrigin origin public string Region { get; } /// - /// Gets the event origin indicating if the event was triggered by a local action or remotly, through the backplane. + /// Gets the event origin indicating if the event was triggered by a local action or remotely, through the backplane. /// public CacheActionEventArgOrigin Origin { get; } diff --git a/src/CacheManager.Core/Internal/SerializerCacheItem.cs b/src/CacheManager.Core/Internal/SerializerCacheItem.cs index 79cbe78e..622530d0 100644 --- a/src/CacheManager.Core/Internal/SerializerCacheItem.cs +++ b/src/CacheManager.Core/Internal/SerializerCacheItem.cs @@ -13,7 +13,7 @@ public interface ICacheItemConverter { /// /// Converts the current instance to a . - /// The returned item must return the orignial created and last accessed date! + /// The returned item must return the original created and last accessed date! /// /// The type. /// The cache item. @@ -73,7 +73,7 @@ public SerializerCacheItem(ICacheItemProperties properties, object value) /// /// Gets or sets the expiration timeout in milliseconds. - /// Can be coverted from and to . + /// Can be converted from and to . /// [DataMember] public abstract double ExpirationTimeout { get; set; } diff --git a/src/CacheManager.Serialization.DataContract/DataContractCacheItem.cs b/src/CacheManager.Serialization.DataContract/DataContractCacheItem.cs index 0af2159e..62c09ef8 100644 --- a/src/CacheManager.Serialization.DataContract/DataContractCacheItem.cs +++ b/src/CacheManager.Serialization.DataContract/DataContractCacheItem.cs @@ -7,7 +7,7 @@ namespace CacheManager.Serialization.DataContract { /// /// The data contract cache item will be used to serialize a . - /// A cannot be derserialized by DataContractSerializer because of the private setters. + /// A cannot be deserialized by DataContractSerializer because of the private setters. /// [DataContract] internal class DataContractCacheItem : SerializerCacheItem diff --git a/src/CacheManager.Serialization.Json/GzJsonCacheSerializer.cs b/src/CacheManager.Serialization.Json/GzJsonCacheSerializer.cs index 59d27fef..3240163c 100644 --- a/src/CacheManager.Serialization.Json/GzJsonCacheSerializer.cs +++ b/src/CacheManager.Serialization.Json/GzJsonCacheSerializer.cs @@ -6,7 +6,7 @@ namespace CacheManager.Serialization.Json { /// - /// Implements the ICacheSerializer contract using Newtonsoft.Json and the loseless compression. + /// Implements the ICacheSerializer contract using Newtonsoft.Json and the lossless compression. /// public class GzJsonCacheSerializer : JsonCacheSerializer { diff --git a/src/CacheManager.StackExchange.Redis/RedisCacheBackplane.cs b/src/CacheManager.StackExchange.Redis/RedisCacheBackplane.cs index c891e853..5af371e7 100644 --- a/src/CacheManager.StackExchange.Redis/RedisCacheBackplane.cs +++ b/src/CacheManager.StackExchange.Redis/RedisCacheBackplane.cs @@ -63,7 +63,7 @@ public RedisCacheBackplane(ICacheManagerConfiguration configuration, ILoggerFact RetryHelper.Retry(() => Subscribe(), configuration.RetryTimeout, configuration.MaxRetries, _logger); // adding additional timer based send message invoke (shouldn't do anything if there are no messages, - // but in really rare race conditions, it might happen messages do not get send if SendMEssages only get invoked through "NotifyXyz" + // but in really rare race conditions, it might happen messages do not get send if SendMessages only get invoked through "NotifyXyz" _timer = new Timer(SendMessages, true, 1000, 1000); } @@ -232,7 +232,7 @@ private void SendMessages(object state) // clearing up only after successfully sending. Basically retrying... _messages.Clear(); - // reset log limmiter because we just send stuff + // reset log limiter because we just send stuff loggedLimitWarningOnce = false; } } diff --git a/src/CacheManager.StackExchange.Redis/RedisCacheHandle.cs b/src/CacheManager.StackExchange.Redis/RedisCacheHandle.cs index 92ea0a22..1bbf54eb 100644 --- a/src/CacheManager.StackExchange.Redis/RedisCacheHandle.cs +++ b/src/CacheManager.StackExchange.Redis/RedisCacheHandle.cs @@ -930,7 +930,7 @@ private bool SetNoScript(CacheItem item, When when, bool sync = fal var setResult = _connection.Database.HashSet(fullKey, HashFieldValue, value, when, flags); - // setResult from fire and forget is alwys false, so we have to assume it works... + // setResult from fire and forget is always false, so we have to assume it works... setResult = flags == CommandFlags.FireAndForget ? true : setResult; if (setResult) diff --git a/src/CacheManager.StackExchange.Redis/RedisConfiguration.cs b/src/CacheManager.StackExchange.Redis/RedisConfiguration.cs index 3dfb3f01..2e282356 100644 --- a/src/CacheManager.StackExchange.Redis/RedisConfiguration.cs +++ b/src/CacheManager.StackExchange.Redis/RedisConfiguration.cs @@ -46,7 +46,7 @@ public RedisConfiguration() /// Enables keyspace notifications to react on eviction/expiration of items. /// Enables Twemproxy mode. /// - /// Gets or sets a version number to eventually reduce the avaible features accessible by cachemanager. + /// Gets or sets a version number to eventually reduce the available features accessible by cachemanager. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Justification = "Using it for configuration data only.")] public RedisConfiguration( @@ -101,7 +101,7 @@ public RedisConfiguration( /// The redis database to use. /// Enables keyspace notifications to react on eviction/expiration of items. /// - /// Gets or sets a version number to eventually reduce the avaible features accessible by cachemanager. + /// Gets or sets a version number to eventually reduce the available features accessible by cachemanager. /// public RedisConfiguration( string key, @@ -146,7 +146,7 @@ private ConfigurationOptions CreateConfigurationOptions() public ConfigurationOptions ConfigurationOptions => _configurationOptions; /// - /// Gets or sets a version number to eventually reduce the avaible features accessible by cachemanager. + /// Gets or sets a version number to eventually reduce the available features accessible by cachemanager. /// E.g. set this to "2.4" to disable LUA support. /// /// diff --git a/src/CacheManager.StackExchange.Redis/RedisConfigurationBuilderExtensions.cs b/src/CacheManager.StackExchange.Redis/RedisConfigurationBuilderExtensions.cs index f2b75ab7..0b7b08f7 100644 --- a/src/CacheManager.StackExchange.Redis/RedisConfigurationBuilderExtensions.cs +++ b/src/CacheManager.StackExchange.Redis/RedisConfigurationBuilderExtensions.cs @@ -15,7 +15,7 @@ public static class RedisConfigurationBuilderExtensions /// /// The builder instance. /// - /// The configuration key which can be used to refernce this configuration by a redis cache handle or backplane. + /// The configuration key which can be used to reference this configuration by a redis cache handle or backplane. /// /// The redis configuration object. /// The configuration builder. @@ -35,7 +35,7 @@ public static ConfigurationBuilderCachePart WithRedisConfiguration(this Configur /// /// The builder instance. /// - /// The configuration key which can be used to refernce this configuration by a redis cache handle or backplane. + /// The configuration key which can be used to reference this configuration by a redis cache handle or backplane. /// /// The redis connection string. /// The redis database to be used. @@ -63,7 +63,7 @@ public static ConfigurationBuilderCachePart WithRedisConfiguration(this Configur /// /// The builder instance. /// - /// The configuration key which can be used to refernce this configuration by a redis cache handle or backplane. + /// The configuration key which can be used to reference this configuration by a redis cache handle or backplane. /// /// The connection multiplexer instance. /// The redis database to use for caching. diff --git a/src/CacheManager.StackExchange.Redis/RedisValueConverter.cs b/src/CacheManager.StackExchange.Redis/RedisValueConverter.cs index b089bfad..4f67d6de 100644 --- a/src/CacheManager.StackExchange.Redis/RedisValueConverter.cs +++ b/src/CacheManager.StackExchange.Redis/RedisValueConverter.cs @@ -103,7 +103,7 @@ public RedisValueConverter(ICacheSerializer serializer) long IRedisValueConverter.FromRedisValue(RedisValue value, string valueType) => (long)value; - // ulong can exceed the supported lenght of storing integers (which is signed 64bit integer) + // ulong can exceed the supported length of storing integers (which is signed 64bit integer) // also, even if we do not exceed long.MaxValue, the SA client stores it as double for no aparent reason => cast to long fixes it. RedisValue IRedisValueConverter.ToRedisValue(ulong value) => value > long.MaxValue ? (RedisValue)value.ToString() : checked((long)value); diff --git a/test/CacheManager.Tests/CacheManagerEventsTest.cs b/test/CacheManager.Tests/CacheManagerEventsTest.cs index 1874fc43..b0d904c2 100644 --- a/test/CacheManager.Tests/CacheManagerEventsTest.cs +++ b/test/CacheManager.Tests/CacheManagerEventsTest.cs @@ -896,7 +896,7 @@ public void Events_OnClearRegion(T cache) cache.OnClear += (sender, args) => data.AddCall(); // this should not trigger cache.OnGet += (sender, args) => data.AddCall(args, key1, key2); // this should not trigger - // on remove now triggeres per cache handle eventually + // on remove now triggers per cache handle eventually cache.OnRemove += (sender, args) => data.AddCall(args, key1, key2); // this should not trigger cache.Put(key1, "something", region1); cache.Put(key2, "something", region2); @@ -1045,7 +1045,7 @@ public void Events_MockedCustomRemove_TestMultiLevelA() level = args.Level; }; - // tests if triggereing the first one really triggers the correct level + // tests if triggering the first one really triggers the correct level var handle = cache.CacheHandles.OfType().First(); handle.TestTrigger("key", null, CacheItemRemovedReason.Expired, null); @@ -1070,7 +1070,7 @@ public void Events_MockedCustomRemove_TestMultiLevelB() level = args.Level; }; - // tests if triggereing the last one really triggers the correct level + // tests if triggering the last one really triggers the correct level var handle = cache.CacheHandles.OfType().Last(); handle.TestTrigger("key", null, CacheItemRemovedReason.Expired, null); diff --git a/test/CacheManager.Tests/CacheManagerExpirationTest.cs b/test/CacheManager.Tests/CacheManagerExpirationTest.cs index 81d53f72..d78c85d9 100644 --- a/test/CacheManager.Tests/CacheManagerExpirationTest.cs +++ b/test/CacheManager.Tests/CacheManagerExpirationTest.cs @@ -500,7 +500,7 @@ public void Expiration_DoesNotAcceptExpirationInThePast(T cache) } } - // Issue #57 - Verifying diggits will be ignored and stored as proper milliseconds value (integer). + // Issue #57 - Verifying digits will be ignored and stored as proper milliseconds value (integer). [Theory] [ClassData(typeof(TestCacheManagers))] public void Expiration_DoesNotBreak_OnVeryPreciseValue(T cache) diff --git a/test/CacheManager.Tests/RedisTests.cs b/test/CacheManager.Tests/RedisTests.cs index bbcb830a..5d7fe8e3 100644 --- a/test/CacheManager.Tests/RedisTests.cs +++ b/test/CacheManager.Tests/RedisTests.cs @@ -240,7 +240,7 @@ await TestBackplaneEventInMemory( CacheEvent.OnAdd, (cacheA, cacheB) => { - // in memory is not distributed, adding only to CacheA the event triggerd on cache B does trigger but cacheB doesn't have the item. + // in memory is not distributed, adding only to CacheA the event triggered on cache B does trigger but cacheB doesn't have the item. cacheB.Add(key, key, region); cacheA.Add(key, key, region); }, @@ -308,7 +308,7 @@ await TestBackplaneEventInMemory( CacheEvent.OnPut, (cacheA, cacheB) => { - // in memory is not distributed, adding only to CacheA the event triggerd on cache B does trigger but cacheB doesn't have the item. + // in memory is not distributed, adding only to CacheA the event triggered on cache B does trigger but cacheB doesn't have the item. cacheA.Add(key, key); cacheA.Put(key, "new val"); }, @@ -1068,7 +1068,7 @@ public void Redis_Valid_CfgFile_LoadWithRedisBackplane() string fileName = TestConfigurationHelper.GetCfgFileName(@"/Configuration/configuration.valid.allFeatures.config"); string cacheName = "redisConfigFromConfig"; - // have to load the configuration manually because the file is not avialbale to the default ConfigurtaionManager + // have to load the configuration manually because the file is not available to the default ConfigurtaionManager RedisConfigurations.LoadConfiguration(fileName, RedisConfigurationSection.DefaultSectionName); var redisConfig = RedisConfigurations.GetConfiguration("redisFromCfgConfigurationId"); @@ -1092,7 +1092,7 @@ public void Redis_Valid_CfgFile_LoadWithConnectionString() string fileName = TestConfigurationHelper.GetCfgFileName(@"/Configuration/configuration.valid.allFeatures.config"); string cacheName = "redisConfigFromConnectionString"; - // have to load the configuration manually because the file is not avialbale to the default ConfigurtaionManager + // have to load the configuration manually because the file is not available to the default ConfigurtaionManager RedisConfigurations.LoadConfiguration(fileName, RedisConfigurationSection.DefaultSectionName); var redisConfig = RedisConfigurations.GetConfiguration("redisConnectionString"); diff --git a/test/CacheManager.Tests/SerializerTests.cs b/test/CacheManager.Tests/SerializerTests.cs index 88c7f404..798b2a71 100644 --- a/test/CacheManager.Tests/SerializerTests.cs +++ b/test/CacheManager.Tests/SerializerTests.cs @@ -1307,7 +1307,7 @@ public void BondBinarySerializer_CacheItemOfObject_Primitives(T value) // act var data = serializer.SerializeCacheItem(item); - // not using the type defined, expecting the serializer object to store the actualy value type correctly... + // not using the type defined, expecting the serializer object to store the actual value type correctly... var result = serializer.DeserializeCacheItem(data, typeof(T)); result.Value.Should().Be(value);