Skip to content

Commit

Permalink
Using Redis with sentinels #11617 (#11637)
Browse files Browse the repository at this point in the history
  • Loading branch information
mazuryv authored May 12, 2022
1 parent 812dcc2 commit e5d4254
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/OrchardCore.Modules/OrchardCore.Redis/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ public override void ConfigureServices(IServiceCollection services)
{
try
{
var configurationOptions = ConfigurationOptions.Parse(_configuration["OrchardCore_Redis:Configuration"]);
var configurationString = _configuration["OrchardCore_Redis:Configuration"];
var _ = ConfigurationOptions.Parse(configurationString);
var instancePrefix = _configuration["OrchardCore_Redis:InstancePrefix"];

services.Configure<RedisOptions>(options =>
{
options.ConfigurationOptions = configurationOptions;
options.Configuration = configurationString;
options.InstancePrefix = instancePrefix;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
namespace OrchardCore.Redis
{
/// <summary>
/// Redis options.
/// Configuration options for <see cref="IRedisService"/>.
/// </summary>
public class RedisOptions
{
/// <summary>
/// The configuration used to connect to Redis.
/// </summary>
public ConfigurationOptions ConfigurationOptions { get; set; }
public ConfigurationOptions ConfigurationOptions => ConfigurationOptions.Parse(Configuration);

/// <summary>
/// The configuration string used to connect to Redis.
/// </summary>
public string Configuration { get; set; }

/// <summary>
/// Prefix alowing a Redis instance to be shared.
Expand Down

0 comments on commit e5d4254

Please sign in to comment.