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 22// The .NET Foundation licenses this file to you under the MIT license. 
33
44using  Aspire . Hosting . ApplicationModel ; 
5+ using  CommunityToolkit . Aspire . SurrealDb ; 
56using  Microsoft . Extensions . DependencyInjection ; 
7+ using  Microsoft . Extensions . Diagnostics . HealthChecks ; 
68using  SurrealDb . Net ; 
79using  System . Text ; 
810using  System . Text . Json ; 
@@ -186,8 +188,16 @@ public static IResourceBuilder<SurrealDbDatabaseResource> AddDatabase(
186188        string  serverName  =  builder . Resource . Parent . Name ; 
187189
188190        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+         
191201        return  builder . ApplicationBuilder . AddResource ( surrealServerDatabase ) 
192202            . WithHealthCheck ( healthCheckKey ) ; 
193203    } 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments