Skip to content

Commit

Permalink
fix: retrieve RedisCacheKeyFormats
Browse files Browse the repository at this point in the history
  • Loading branch information
jvandaal authored and ArneD committed Sep 27, 2024
1 parent 46e3806 commit b85cd53
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ internal sealed class RedisCacheInvalidateService: IRedisCacheInvalidateService

public RedisCacheInvalidateService(IConfiguration configuration)
{
_cacheKeyFormats = configuration.GetValue<string[]>("RedisCacheKeyFormats")
?? throw new ArgumentException("No 'RedisCacheKeyFormats' configuration found");
_cacheKeyFormats = configuration.GetSection("RedisCacheKeyFormats")
.GetChildren()
.Select(c => c.Value!)
.ToArray();

if (_cacheKeyFormats.Length == 0)
{
throw new ArgumentException("No 'RedisCacheKeyFormats' configuration found");
}

_connectionString = configuration.GetConnectionString("LastChangedList")
?? throw new ArgumentException("No connectionstring 'LastChangedList' found");
}
Expand Down

0 comments on commit b85cd53

Please sign in to comment.