Skip to content

Commit

Permalink
cache: add data protection store
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Sep 13, 2022
1 parent d0b34bf commit e35e680
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions GZCTF/CTFServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<PackageReference Include="MailKit" Version="3.4.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Redis" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.8" />
<PackageReference Include="StackExchange.Redis" Version="2.6.66" />
</ItemGroup>

<ItemGroup>
Expand All @@ -72,6 +73,8 @@
<None Remove="MailKit" />
<None Remove="Microsoft.Extensions.Caching.Redis" />
<None Remove="Microsoft.EntityFrameworkCore.InMemory" />
<None Remove="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<None Remove="StackExchange.Redis" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion GZCTF/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,13 @@
}
else
{
var constr = builder.Configuration.GetConnectionString("RedisCache");
builder.Services.AddDistributedRedisCache(options =>
{
options.Configuration = builder.Configuration.GetConnectionString("RedisCache");
options.Configuration = constr;
});

builder.Services.AddDataProtection().Services.AddDistributedMemoryCache();
}

#endregion Cache
Expand Down

0 comments on commit e35e680

Please sign in to comment.