Skip to content

Commit

Permalink
fix: le settings
Browse files Browse the repository at this point in the history
  • Loading branch information
arealmaas committed Apr 3, 2024
1 parent 9a25d9c commit b67cb3e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ public static IServiceCollection AddInfrastructure(this IServiceCollection servi

// todo: do we need default cache? 🤔
ConfigureFusionCache(services);
ConfigureFusionCache(services, nameof(NameRegistryClient), new()
ConfigureFusionCache(services, nameof(Altinn.NameRegistry), new()
{
Duration = TimeSpan.FromDays(1),
});
ConfigureFusionCache(services, nameof(ResourceRegistryClient), new()
ConfigureFusionCache(services, nameof(Altinn.ResourceRegistry), new()
{
Duration = TimeSpan.FromDays(1),
});
ConfigureFusionCache(services, nameof(OrganizationRegistryClient), new()
ConfigureFusionCache(services, nameof(Altinn.OrganizationRegistry), new()
{
Duration = TimeSpan.FromDays(1),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ internal sealed class RedisSettingsValidator : AbstractValidator<RedisSettings>
public RedisSettingsValidator()
{
RuleFor(x => x.Enabled).Must(x => x is false or true);
RuleFor(x => x.ConnectionString).NotEmpty();

When(x => x.Enabled == true, () =>
{
RuleFor(x => x.ConnectionString).NotEmpty();
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"Password": "guest"
},
"Infrastructure": {
"Redis": {
"Enabled": false
},
"DialogDbConnectionString": "TODO: Add to local secrets",
// Settings from appsettings.json, environment variables or other configuration providers.
// The first three are always mandatory for all client definitions types
Expand Down

0 comments on commit b67cb3e

Please sign in to comment.