Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Brunobento1990 committed Feb 2, 2025
1 parent bc4f696 commit 9bd2d7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion OpenAdm.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
var servidor = VariaveisDeAmbiente.GetVariavel("SERVER");
var senha = VariaveisDeAmbiente.GetVariavel("SENHA");
var urlConsultaCnpj = VariaveisDeAmbiente.GetVariavel("ULR_CONSULTA_CNPJ");
var instanceName = VariaveisDeAmbiente.GetVariavel("REDIS_INSTANCENAME");
var porta = int.Parse(VariaveisDeAmbiente.GetVariavel("PORT"));

ConfiguracaoDeToken.Configure(keyJwt, issue, audience, expirate);
Expand All @@ -45,7 +46,7 @@
builder.Services.InjectCors();
builder.Services.InjectJwt(keyJwt, issue, audience);
builder.Services.InjectContext(pgString);
builder.Services.InjectRepositories(redisString);
builder.Services.InjectRepositories(redisString, instanceName);
builder.Services.InjectHttpClient(urlDiscord, urlApiCep, urlApiMercadoPago, urlConsultaCnpj);

QuestPDF.Settings.License = LicenseType.Community;
Expand Down
3 changes: 2 additions & 1 deletion OpenAdm.IoC/DependencyInjectRepositories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ namespace OpenAdm.IoC;

public static class DependencyInjectRepositories
{
public static void InjectRepositories(this IServiceCollection services, string connectionString)
public static void InjectRepositories(this IServiceCollection services, string connectionString, string instanceName)
{
services.AddStackExchangeRedisCache(options =>
{
options.Configuration = connectionString;
options.InstanceName = instanceName;
});

services.AddScoped(typeof(ICachedService<>), typeof(CachedService<>));
Expand Down

0 comments on commit 9bd2d7a

Please sign in to comment.