You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(caching): HashIncrementAsync, HashDecrementAsync support sliding expiration (#314)
* fix(Caching): Fix HashIncrementAsync, HashDecrementAsync do not support sliding expiration
* chore(Caching): Dealing with bad code smells
* chore(Caching): Add description
/// <param name="options">Configure the cache life cycle, which is consistent with the default configuration when it is empty (is only initialized if the configuration does not exist)</param>
123
+
/// <returns>Returns the field value after the increment operation</returns>
124
+
Task<long>HashIncrementAsync(stringkey,
125
+
longvalue=1L,
126
+
Action<CacheOptions>?action=null,
127
+
CacheEntryOptions?options=null);
124
128
125
129
/// <summary>
126
130
/// Descending Hash
127
131
/// </summary>
128
132
/// <param name="key">cache key</param>
129
133
/// <param name="value">decrement increment, must be greater than 0</param>
130
-
/// <param name="defaultMinVal">critical value, must be greater than or equal to 0</param>
/// <param name="options">Configure the cache life cycle, which is consistent with the default configuration when it is empty (is only initialized if the configuration does not exist)</param>
137
+
/// <returns>Returns null on failure, and returns the field value after the decrement operation on success</returns>
/// <param name="value">incremental increment, must be greater than 0</param>
394
+
/// <param name="action">Cache configuration, used to change the global cache configuration information</param>
395
+
/// <param name="options">Configure the cache life cycle, which is consistent with the default configuration when it is empty (is only initialized if the configuration does not exist)</param>
396
+
/// <returns>Returns the field value after the increment operation</returns>
397
+
publicoverrideasyncTask<long>HashIncrementAsync(
398
+
stringkey,
399
+
longvalue=1,
400
+
Action<CacheOptions>?action=null,
401
+
CacheEntryOptions?options=null)
390
402
{
391
-
if(value<=0)thrownewArgumentOutOfRangeException(nameof(value),$"{nameof(value)} must be greater than 0");
/// <param name="action">Cache configuration, used to change the global cache configuration information</param>
438
+
/// <param name="options">Configure the cache life cycle, which is consistent with the default configuration when it is empty (is only initialized if the configuration does not exist)</param>
439
+
/// <returns>Returns null on failure, and returns the field value after the decrement operation on success</returns>
Copy file name to clipboardExpand all lines: src/Contrib/Caching/Distributed/Tests/Masa.Contrib.Caching.Distributed.StackExchangeRedis.Tests/DistributedCacheClientTest.cs
0 commit comments