retry the quick connect startup probe, and exit non-zero when a start fails
This commit is contained in:
@@ -10,9 +10,14 @@ using StackExchange.Redis;
|
||||
namespace Emby.Server.Implementations.MediaEncoding;
|
||||
|
||||
/// <summary>
|
||||
/// Pings the configured Redis transcode session store once at startup so an unreachable store is
|
||||
/// reported there instead of being discovered as a silent loss of cross-pod takeover.
|
||||
/// Reports the round trip to the configured Redis transcode session store once at startup, so the
|
||||
/// state of cross-pod takeover is visible where the server is started.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This reports, it does not gate. <see cref="ApplicationHost.InitializeServices"/> has already read the
|
||||
/// same connection for quick connect by the time this runs and has stopped startup if it could not be
|
||||
/// reached, so the error branch here only covers a store that went away in between.
|
||||
/// </remarks>
|
||||
public sealed class TranscodeStoreConnectivityProbe : IHostedService
|
||||
{
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
@@ -34,7 +39,7 @@ public sealed class TranscodeStoreConnectivityProbe : IHostedService
|
||||
{
|
||||
try
|
||||
{
|
||||
// Resolved here rather than injected: connecting must not be able to abort startup.
|
||||
// Resolved here rather than injected so a store lost after the quick connect gate is reported.
|
||||
var redis = _serviceProvider.GetRequiredService<IConnectionMultiplexer>();
|
||||
var roundTrip = await redis.GetDatabase().PingAsync().ConfigureAwait(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user