Skip to content

Commit 3ddedb1

Browse files
committed
fix
1 parent 0925006 commit 3ddedb1

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Boilerplate.Server.AppHost.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Aspire.AppHost.Sdk/13.3.3">
1+
<Project Sdk="Aspire.AppHost.Sdk/13.3.4">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Infrastructure/Extensions/IDistributedApplicationBuilderExtensions.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
using Aspire.Hosting.Maui;
33
using Aspire.Hosting.Azure;
44
using Aspire.Hosting.DevTunnels;
5+
//#if (redis == true)
56
using Azure.Provisioning.RedisEnterprise;
7+
//#endif
68

79
namespace Aspire.Hosting;
810

@@ -20,7 +22,25 @@ public static IResourceBuilder<AzureManagedRedisResource> AddRedisCache(this IDi
2022
{
2123
redis.WithRedisInsight()
2224
.WithRedisCommander()
23-
.WithImage("redis/redis-stack", "latest");
25+
.WithImage("redis/redis-stack", "latest")
26+
.WithArgs(
27+
"--save", "", // Backend API has its own L1 in-memory cache, no need to have RDB snapshots for the L2 redis cache in case of failures.
28+
"--appendonly", "no", // Disables AOF persistence as well for the same reason.
29+
"--maxmemory-policy", "allkeys-lru" // Evict least recently used keys when memory limit is reached
30+
);
31+
}).ConfigureInfrastructure(infra =>
32+
{
33+
var db = infra.GetProvisionableResources()
34+
.OfType<RedisEnterpriseDatabase>()
35+
.Single();
36+
37+
db.Persistence = new()
38+
{
39+
IsAofEnabled = false,
40+
IsRdbEnabled = false
41+
};
42+
43+
db.EvictionPolicy = RedisEnterpriseEvictionPolicy.AllKeysLru;
2444
});
2545
}
2646

@@ -81,7 +101,7 @@ public static IResourceBuilder<AzureSqlDatabaseResource> AddSqlServer(this IDist
81101
}
82102
//#endif
83103

84-
//#if (database == "PostgreSql")
104+
//#if (database == "PostgreSQL")
85105
/// <summary>
86106
/// Adds a PostgreSQL Server instance with pgAdmin and a database named <c>postgresdb</c>.
87107
/// Uses pgvector (pg18) image which supports embedded vector search.

0 commit comments

Comments
 (0)