Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Brunobento1990 committed Oct 28, 2024
1 parent 4a1b51e commit 3cee0fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions OpenAdm.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
app.UseSwagger(c =>
{
c.RouteTemplate = "swagger/{documentName}/swagger.json";
c.PreSerializeFilters.Add((swaggerDoc, httpReq) =>
{
swaggerDoc.Servers = new List<OpenApiServer> { new OpenApiServer { Url = $"{httpReq.Scheme}://{httpReq.Host.Value}{basePath}" } };
});
//c.PreSerializeFilters.Add((swaggerDoc, httpReq) =>
//{
// swaggerDoc.Servers = new List<OpenApiServer> { new OpenApiServer { Url = $"{httpReq.Scheme}://{httpReq.Host.Value}{basePath}" } };
//});
});
app.UseSwaggerUI();
}
Expand Down
6 changes: 3 additions & 3 deletions OpenAdm.Infra/Cached/Services/CachedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class CachedService<T> : ICachedService<T> where T : class
private readonly JsonSerializerOptions _serializerOptions;
private static readonly double _absolutExpiration = 5;
private static readonly double _slidingExpiration = 3;
private readonly string _keyParceiro;
private readonly IParceiroAutenticado _parceiroAutenticado;

public CachedService(IDistributedCache distributedCache,
IParceiroAutenticado parceiroAutenticado)
Expand All @@ -29,7 +29,7 @@ public CachedService(IDistributedCache distributedCache,
.SetSlidingExpiration(TimeSpan.FromMinutes(_slidingExpiration));

_distributedCache = distributedCache;
_keyParceiro = parceiroAutenticado.KeyParceiro;
_parceiroAutenticado = parceiroAutenticado;
}

public async Task<T?> GetItemAsync(string key)
Expand Down Expand Up @@ -74,6 +74,6 @@ private static void Valid(string key)

private string GetNewKey(string key)
{
return $"{_keyParceiro}-{key}";
return $"{_parceiroAutenticado.KeyParceiro}-{key}";
}
}

0 comments on commit 3cee0fb

Please sign in to comment.