1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

add azure to signalRServerBuilder

This commit is contained in:
Kyle Spearrin 2018-08-27 11:20:09 -04:00
parent 7fd79388e2
commit a2f5f7730f

View File

@ -49,19 +49,16 @@ namespace Bit.Notifications
});
// SignalR
var signalRServerBuilder = services.AddSignalR().AddMessagePackProtocol(options =>
{
options.FormatterResolvers = new List<MessagePack.IFormatterResolver>()
{
MessagePack.Resolvers.ContractlessStandardResolver.Instance
};
});
if(!string.IsNullOrWhiteSpace(globalSettings.Notifications?.AzureSignalRConnectionString))
{
services.AddSignalR().AddAzureSignalR(globalSettings.Notifications.AzureSignalRConnectionString);
}
else
{
services.AddSignalR().AddMessagePackProtocol(options =>
{
options.FormatterResolvers = new List<MessagePack.IFormatterResolver>()
{
MessagePack.Resolvers.ContractlessStandardResolver.Instance
};
});
signalRServerBuilder.AddAzureSignalR(globalSettings.Notifications.AzureSignalRConnectionString);
}
services.AddSingleton<IUserIdProvider, SubjectUserIdProvider>();
services.AddSingleton<ConnectionCounter>();