File tree 3 files changed +8
-3
lines changed
Extensions.Caching.PostgreSql
3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public DatabaseExpiredItemsRemoverLoop(
25
25
{
26
26
var cacheOptions = options . Value ;
27
27
28
- if ( ( _disabled = cacheOptions . Disabled ) == true )
28
+ if ( ( _disabled = cacheOptions . DisableRemoveExpired ) == true )
29
29
{
30
30
//No need to configure anything
31
31
return ;
Original file line number Diff line number Diff line change @@ -43,9 +43,11 @@ public class PostgreSqlCacheOptions : IOptions<PostgreSqlCacheOptions>
43
43
public TimeSpan DefaultSlidingExpiration { get ; set ; } = TimeSpan . FromMinutes ( 20 ) ;
44
44
45
45
/// <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.
47
49
/// </summary>
48
- public bool Disabled { get ; set ; }
50
+ public bool DisableRemoveExpired { get ; set ; } = false ;
49
51
50
52
PostgreSqlCacheOptions IOptions < PostgreSqlCacheOptions > . Value => this ;
51
53
}
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ services.AddDistributedPostgreSqlCache(setup =>
17
17
ConnectionString = configuration [" ConnectionString" ],
18
18
SchemaName = configuration [" SchemaName" ],
19
19
TableName = configuration [" TableName" ],
20
+ RemoveExpiredDisabled = configuration [" RemoveExpiredDisabled" ],
21
+ // Optional - RemoveExpiredDisabled default is FALSE
20
22
CreateInfrastructure = configuration [" CreateInfrastructure" ]
21
23
// CreateInfrastructure is optional, default is TRUE
22
24
// This means que every time starts the application the
@@ -65,6 +67,7 @@ Then you can delete the database with:
65
67
prepare-database.cmd -erase
66
68
```
67
69
## Change Log
70
+ 1 . v3.0.1 - ` DisableRemoveExpired ` configuration added; If ` TRUE ` the cache instance won`t delete expired items.
68
71
1 . v3.0
69
72
1 . [ BREAKING CHANGE] - Direct instantiation not preferred
70
73
2 . Single thread loop remover
You can’t perform that action at this time.
0 commit comments