mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-22 22:15:17 -04:00
New: Multi target net framework 4.6.2 and net core 3.0
This commit is contained in:
@@ -15,6 +15,7 @@ namespace Radarr.Host.Middleware
|
||||
private readonly IContainer _container;
|
||||
private readonly Logger _logger;
|
||||
private static string API_KEY;
|
||||
private static string URL_BASE;
|
||||
public int Order => 1;
|
||||
|
||||
public SignalRMiddleware(IContainer container,
|
||||
@@ -24,6 +25,7 @@ namespace Radarr.Host.Middleware
|
||||
_container = container;
|
||||
_logger = logger;
|
||||
API_KEY = configFileProvider.ApiKey;
|
||||
URL_BASE = configFileProvider.UrlBase;
|
||||
}
|
||||
|
||||
public void Attach(IApplicationBuilder appBuilder)
|
||||
@@ -55,11 +57,17 @@ namespace Radarr.Host.Middleware
|
||||
}
|
||||
});
|
||||
|
||||
appBuilder.UseSignalR(routes =>
|
||||
#if NETCOREAPP3_0
|
||||
appBuilder.UseEndpoints(x =>
|
||||
{
|
||||
routes.MapHub<MessageHub>("/signalr/messages");
|
||||
x.MapHub<MessageHub>(URL_BASE + "/signalr/messages");
|
||||
});
|
||||
|
||||
#else
|
||||
appBuilder.UseSignalR(x =>
|
||||
{
|
||||
x.MapHub<MessageHub>("/signalr/messages");
|
||||
});
|
||||
#endif
|
||||
// This is a side effect of haing multiple IoC containers, TinyIoC and whatever
|
||||
// Kestrel/SignalR is using. Ideally we'd have one IoC container, but that's non-trivial with TinyIoC
|
||||
// TODO: Use a single IoC container if supported for TinyIoC or if we switch to another system (ie Autofac).
|
||||
|
||||
Reference in New Issue
Block a user