Skip to content

Commit 7be7971

Browse files
committed
change property name and update docs
1 parent 3dcf3c2 commit 7be7971

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Extensions.Caching.PostgreSql/DatabaseExpiredItemsRemoverLoop.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public DatabaseExpiredItemsRemoverLoop(
2525
{
2626
var cacheOptions = options.Value;
2727

28-
if ((_disabled = cacheOptions.Disabled) == true)
28+
if ((_disabled = cacheOptions.DisableRemoveExpired) == true)
2929
{
3030
//No need to configure anything
3131
return;

Extensions.Caching.PostgreSql/PostGreSqlCacheOptions.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ public class PostgreSqlCacheOptions : IOptions<PostgreSqlCacheOptions>
4343
public TimeSpan DefaultSlidingExpiration { get; set; } = TimeSpan.FromMinutes(20);
4444

4545
/// <summary>
46-
/// If set to true this instance of the cache will not remove expired items.
46+
/// If set to true this instance of the cache will not remove expired items.
47+
/// Maybe on multiple instances scenario sharing the same database another instance will be responsable for remove expired itens.
48+
/// Default value is false.
4749
/// </summary>
48-
public bool Disabled { get; set; }
50+
public bool DisableRemoveExpired { get; set; } = false;
4951

5052
PostgreSqlCacheOptions IOptions<PostgreSqlCacheOptions>.Value => this;
5153
}

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ services.AddDistributedPostgreSqlCache(setup =>
1717
ConnectionString = configuration["ConnectionString"],
1818
SchemaName = configuration["SchemaName"],
1919
TableName = configuration["TableName"],
20+
RemoveExpiredDisabled = configuration["RemoveExpiredDisabled"],
21+
// Optional - RemoveExpiredDisabled default is FALSE
2022
CreateInfrastructure = configuration["CreateInfrastructure"]
2123
// CreateInfrastructure is optional, default is TRUE
2224
// This means que every time starts the application the
@@ -65,6 +67,7 @@ Then you can delete the database with:
6567
prepare-database.cmd -erase
6668
```
6769
## Change Log
70+
1. v3.0.1 - `DisableRemoveExpired` configuration added; If `TRUE` the cache instance won`t delete expired items.
6871
1. v3.0
6972
1. [BREAKING CHANGE] - Direct instantiation not preferred
7073
2. Single thread loop remover

0 commit comments

Comments
 (0)