File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
4
using Aspire . Hosting . ApplicationModel ;
5
+ using CommunityToolkit . Aspire . SurrealDb ;
5
6
using Microsoft . Extensions . DependencyInjection ;
7
+ using Microsoft . Extensions . Diagnostics . HealthChecks ;
6
8
using SurrealDb . Net ;
7
9
using System . Text ;
8
10
using System . Text . Json ;
@@ -186,8 +188,16 @@ public static IResourceBuilder<SurrealDbDatabaseResource> AddDatabase(
186
188
string serverName = builder . Resource . Parent . Name ;
187
189
188
190
string healthCheckKey = $ "{ serverName } _{ namespaceName } _{ name } _check";
189
- builder . ApplicationBuilder . Services . AddHealthChecks ( ) . AddSurreal ( _ => surrealDbClient ! , healthCheckKey ) ;
190
-
191
+ // TODO : Bug to be fixed
192
+ //builder.ApplicationBuilder.Services.AddHealthChecks().AddSurreal(_ => surrealDbClient!, healthCheckKey);
193
+ builder . ApplicationBuilder . Services . AddHealthChecks ( ) . Add ( new HealthCheckRegistration (
194
+ name : healthCheckKey ,
195
+ _ => new SurrealDbHealthCheck ( surrealDbClient ! ) ,
196
+ failureStatus : null ,
197
+ tags : null
198
+ )
199
+ ) ;
200
+
191
201
return builder . ApplicationBuilder . AddResource ( surrealServerDatabase )
192
202
. WithHealthCheck ( healthCheckKey ) ;
193
203
}
You can’t perform that action at this time.
0 commit comments