Skip to content

Commit 706ac4c

Browse files
Make the custom check work in both embedded and external mode
1 parent 7180944 commit 706ac4c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ServiceControl.Audit.Persistence.RavenDB/MemoryInformationRetriever.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ namespace ServiceControl.Audit.Persistence.RavenDB;
88

99
class MemoryInformationRetriever(DatabaseConfiguration databaseConfiguration)
1010
{
11-
readonly HttpClient client = new() { BaseAddress = new Uri(databaseConfiguration.ServerConfiguration.ServerUrl) };
11+
// TODO what does a connection string look like? Is it only a URI or could it contain other stuff?
12+
// The ?? operator is needed because ServerUrl is populated when running embedded and connection string when running in external mode.
13+
// However the tricky part is that when tests are run they behave like if it was external mode
14+
readonly HttpClient client = new() { BaseAddress = new Uri(databaseConfiguration.ServerConfiguration.ServerUrl ?? databaseConfiguration.ServerConfiguration.ConnectionString) };
1215

1316
record ResponseDto
1417
{

0 commit comments

Comments
 (0)