b662ffa48f
Add a Redis pub/sub invalidation bus, publish from the configuration and library-option write paths, and drop the matching local cache entry on the instances that did not write. No-op without a Redis connection string, and fails open when it is unreachable.
27 lines
1.0 KiB
C#
27 lines
1.0 KiB
C#
namespace MediaBrowser.Common.Configuration
|
|
{
|
|
/// <summary>
|
|
/// A notice that one instance has written shared configuration, so every other instance has to drop
|
|
/// its locally cached copy and read the shared file again.
|
|
/// </summary>
|
|
public sealed class ConfigurationInvalidation
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the cache this notice refers to.
|
|
/// </summary>
|
|
public ConfigurationInvalidationScope Scope { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets what was invalidated within the scope: the configuration key for
|
|
/// <see cref="ConfigurationInvalidationScope.NamedConfiguration"/>, the library path for
|
|
/// <see cref="ConfigurationInvalidationScope.LibraryOptions"/>, and <c>null</c> otherwise.
|
|
/// </summary>
|
|
public string? Target { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the identity of the instance that published the notice, so it can ignore its own.
|
|
/// </summary>
|
|
public string? OriginId { get; set; }
|
|
}
|
|
}
|