1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 05:00:19 -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);

View File

@ -12,7 +12,7 @@
"DataTableProxy": "1.2.0",
"Sendgrid": "6.3.4",
"StackExchange.Redis": "1.0.488",
"StackExchange.Redis.Extensions.Protobuf": "1.3.5",
"StackExchange.Redis.Extensions.Newtonsoft": "1.3.5",
"PushSharp": "4.0.10"
},