1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

switch to json.net serializer for redis

This commit is contained in:
Kyle Spearrin
2016-06-21 19:41:48 -04:00
parent 6f7b8314bc
commit a07a682831
2 changed files with 7 additions and 3 deletions

View File

@ -19,8 +19,9 @@ using Bit.Core.Services;
using Repos = Bit.Core.Repositories.SqlServer;
using System.Text;
using StackExchange.Redis.Extensions.Core;
using StackExchange.Redis.Extensions.Protobuf;
using StackExchange.Redis.Extensions.Newtonsoft;
using Loggr.Extensions.Logging;
using Newtonsoft.Json;
namespace Bit.Api
{
@ -58,7 +59,10 @@ namespace Bit.Api
services.AddSingleton(s => globalSettings);
// Caching
ISerializer serializer = new ProtobufSerializer();
ISerializer serializer = new NewtonsoftSerializer(new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
});
services.AddSingleton(s => serializer);
ICacheClient cacheClient = new StackExchangeRedisCacheClient(serializer,
globalSettings.Cache.ConnectionString, globalSettings.Cache.Database);