临时数据清理缓存

This commit is contained in:
Hinse 2022-03-30 10:49:47 +08:00
parent 39c3bfa21f
commit 09ad0dfdfe
1 changed files with 2 additions and 1 deletions

View File

@ -413,6 +413,7 @@ namespace Waste.Application.ThirdApiInfo
var databytes = await _cahce.GetAsync(result.sn);
if (databytes != null && databytes.Length > 0)
{
await _cahce.RemoveAsync(result.sn);
byte[] newval = new byte[databytes.Length + result.databyte.Length];
databytes.CopyTo(newval, 0);
result.databyte.CopyTo(newval, databytes.Length);
@ -441,7 +442,7 @@ namespace Waste.Application.ThirdApiInfo
else
{
var val = await _cahce.GetAsync(result.sn);
var time = new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(10));
var time = new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(30));
if (val != null && val.Length > 0)
{
byte[] newval = new byte[val.Length + result.databyte.Length];