use connection strings for redis

This commit is contained in:
Ryan Peters 2024-01-23 11:23:05 -05:00
parent f2ff558d2c
commit 100e782d9c
4 changed files with 11 additions and 9 deletions

View File

@ -8,16 +8,10 @@
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"BinaryDad.Coding": {
"commandName": "Project",
"launchBrowser": true,
"hotReloadEnabled": false,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},

View File

@ -32,8 +32,10 @@ namespace BinaryDad.Coding
{
AbortOnConnectFail = false
};
config.EndPoints.Add("redis:6379");
config.EndPoints.Add(Configuration.GetConnectionString("Redis"));
config.SetDefaultPorts();
var connection = await ConnectionMultiplexer.ConnectAsync(config, writer);
connection.ConnectionFailed += (_, e) =>
{

View File

@ -6,5 +6,8 @@
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ConnectionStrings": {
"Redis": "cluster.home.lan:6379"
}
}

View File

@ -6,5 +6,8 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
"AllowedHosts": "*",
"ConnectionStrings": {
"Redis": "redis:6379"
}
}