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.
28 lines
910 B
C#
28 lines
910 B
C#
using System;
|
|
|
|
namespace MediaBrowser.Common.Configuration
|
|
{
|
|
/// <summary>
|
|
/// A no-op <see cref="IConfigurationInvalidationBus"/> used by single-instance installs and whenever
|
|
/// the shared bus is unavailable. Every instance keeps its own cached configuration, which is the
|
|
/// behaviour of an install that has only one.
|
|
/// </summary>
|
|
public sealed class NullConfigurationInvalidationBus : IConfigurationInvalidationBus
|
|
{
|
|
/// <summary>
|
|
/// Gets the shared instance.
|
|
/// </summary>
|
|
public static NullConfigurationInvalidationBus Instance { get; } = new NullConfigurationInvalidationBus();
|
|
|
|
/// <inheritdoc />
|
|
public void Publish(ConfigurationInvalidationScope scope, string? target)
|
|
{
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public void Subscribe(Action<ConfigurationInvalidation> handler)
|
|
{
|
|
}
|
|
}
|
|
}
|