diff --git a/dotnet-authserver/src/TeacherIdentity.AuthServer/Services/Zendesk/ServiceCollectionExtensions.cs b/dotnet-authserver/src/TeacherIdentity.AuthServer/Services/Zendesk/ServiceCollectionExtensions.cs index 6aa496e84..06e2c9e84 100644 --- a/dotnet-authserver/src/TeacherIdentity.AuthServer/Services/Zendesk/ServiceCollectionExtensions.cs +++ b/dotnet-authserver/src/TeacherIdentity.AuthServer/Services/Zendesk/ServiceCollectionExtensions.cs @@ -1,4 +1,3 @@ -using Microsoft.Extensions.Diagnostics.HealthChecks; using ZendeskApi.Client; using ZendeskApi.Client.Options; @@ -24,14 +23,6 @@ public static IServiceCollection AddZendesk( services.AddScoped(); services.AddScoped(); services.AddScoped(); - services.AddTransient(); - - services.AddHealthChecks().Add( - new HealthCheckRegistration( - "Zendesk", - sp => sp.GetRequiredService(), - HealthStatus.Unhealthy, - tags: null)); } } diff --git a/dotnet-authserver/src/TeacherIdentity.AuthServer/Services/Zendesk/ZendeskHealthCheck.cs b/dotnet-authserver/src/TeacherIdentity.AuthServer/Services/Zendesk/ZendeskHealthCheck.cs deleted file mode 100644 index bfdb52de2..000000000 --- a/dotnet-authserver/src/TeacherIdentity.AuthServer/Services/Zendesk/ZendeskHealthCheck.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.Extensions.Diagnostics.HealthChecks; -using ZendeskApi.Client; -using ZendeskApi.Client.Models; - -namespace TeacherIdentity.AuthServer.Services.Zendesk; - -public class ZendeskHealthCheck : IHealthCheck -{ - private readonly IZendeskClient _zendeskClient; - - public ZendeskHealthCheck(IZendeskClient zendeskClient) - { - _zendeskClient = zendeskClient; - } - - public async Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) - { - try - { - var tickets = await _zendeskClient.Tickets.GetAllAsync(new CursorPager() { Size = 10 }, cancellationToken); - return HealthCheckResult.Healthy(); - } - catch (Exception ex) - { - return HealthCheckResult.Unhealthy(exception: ex); - } - } -}