Fix bug introduced in 730bc9a

730bc9a4d1
This commit is contained in:
genteure 2022-05-17 15:14:45 +08:00
parent 27d1a18bae
commit a993fca683
6 changed files with 9 additions and 7 deletions

View File

@ -15,7 +15,7 @@ namespace BililiveRecorder.Core
{
private static readonly ILogger logger = Log.ForContext<PollyPolicy>();
internal PollyPolicy()
public PollyPolicy()
{
this.IpBlockedHttp412CircuitBreakerPolicy = Policy
.Handle<Http412Exception>()
@ -68,7 +68,6 @@ namespace BililiveRecorder.Core
this[PolicyNames.PolicyRoomInfoApiRequestAsync] = Policy.WrapAsync(bulkhead, retry, this.IpBlockedHttp412CircuitBreakerPolicy, this.RequestFailedCircuitBreakerPolicy);
this[PolicyNames.PolicyDanmakuApiRequestAsync] = Policy.WrapAsync(cachePolicy, bulkhead, retry, this.IpBlockedHttp412CircuitBreakerPolicy, this.RequestFailedCircuitBreakerPolicy);
this[PolicyNames.PolicyStreamApiRequestAsync] = Policy.WrapAsync(bulkhead, retry, this.IpBlockedHttp412CircuitBreakerPolicy, this.RequestFailedCircuitBreakerPolicy);
}
public readonly MemoryCache memoryCache;

View File

@ -51,7 +51,7 @@ namespace BililiveRecorder.Core
private DateTimeOffset danmakuClientConnectTime;
private static readonly TimeSpan danmakuClientReconnectNoDelay = TimeSpan.FromMinutes(1);
internal Room(IServiceScope scope, RoomConfig roomConfig, int initDelayFactor, ILogger logger, IDanmakuClient danmakuClient, IApiClient apiClient, IBasicDanmakuWriter basicDanmakuWriter, IRecordTaskFactory recordTaskFactory)
public Room(IServiceScope scope, RoomConfig roomConfig, int initDelayFactor, ILogger logger, IDanmakuClient danmakuClient, IApiClient apiClient, IBasicDanmakuWriter basicDanmakuWriter, IRecordTaskFactory recordTaskFactory)
{
this.scope = scope ?? throw new ArgumentNullException(nameof(scope));
this.RoomConfig = roomConfig ?? throw new ArgumentNullException(nameof(roomConfig));

View File

@ -280,7 +280,7 @@ namespace BililiveRecorder.WPF
private class SentryEventProcessor : ISentryEventProcessor
{
private const string JintConsole = "Core.Scripting.Runtime.JintConsole";
private const string JintConsole = "BililiveRecorder.Core.Scripting.Runtime.JintConsole";
private static readonly string UserScriptRunner = typeof(Core.Scripting.UserScriptRunner).FullName;
public SentryEvent? Process(SentryEvent e) => (e?.Logger == JintConsole || e?.Logger == UserScriptRunner) ? null : e;
}

View File

@ -404,6 +404,7 @@ namespace BililiveRecorder.Core
public readonly Polly.CircuitBreaker.AsyncCircuitBreakerPolicy IpBlockedHttp412CircuitBreakerPolicy;
public readonly Polly.CircuitBreaker.AsyncCircuitBreakerPolicy RequestFailedCircuitBreakerPolicy;
public readonly Microsoft.Extensions.Caching.Memory.MemoryCache memoryCache;
public PollyPolicy() { }
}
public class RoomStats : System.ComponentModel.INotifyPropertyChanged
{
@ -488,4 +489,4 @@ namespace BililiveRecorder.DependencyInjection
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddRecorderConfig(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, BililiveRecorder.Core.Config.V3.ConfigV3 config) { }
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddRecorderRecording(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) { }
}
}
}

View File

@ -12,7 +12,8 @@ namespace BililiveRecorder.Core.UnitTests
{
VerifierSettings.DerivePathInfo(Expectations.Initialize);
VerifierSettings.ModifySerialization(_ => _.IgnoreMembersWithType<Stream>());
DiffRunner.Disabled = true;
DiffRunner.Disabled = false;
DiffTools.UseOrder(DiffTool.VisualStudioCode, DiffTool.Rider, DiffTool.WinMerge, DiffTool.VisualStudio);
}
}
}

View File

@ -12,7 +12,8 @@ namespace BililiveRecorder.Flv.Tests
{
VerifierSettings.DerivePathInfo(Expectations.Initialize);
VerifierSettings.ModifySerialization(_ => _.IgnoreMembersWithType<Stream>());
DiffRunner.Disabled = true;
DiffRunner.Disabled = false;
DiffTools.UseOrder(DiffTool.VisualStudioCode, DiffTool.Rider, DiffTool.WinMerge, DiffTool.VisualStudio);
}
}
}