Skip to content

Commit

Permalink
typo in tests and document snippet link removed
Browse files Browse the repository at this point in the history
  • Loading branch information
daveHylde authored and oskardudycz committed Aug 29, 2023
1 parent 25be967 commit 4f89877
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 0 additions & 4 deletions docs/events/projections/healthchecks.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ Marten supports a customizable [HealthChecks](https://learn.microsoft.com/en-us/

> The healthcheck will only be checked against `Async` projections
<!-- snippet: sample_AddMartenAsyncDaemonHealthCheck -->
<a id='sample_addmartenasyncdaemonhealthcheck'></a>
```cs
// Add HealthCheck
Services.AddHealthChecks().AddMartenAsyncDaemonHealthCheck(maxEventLag: 500);

// Map HealthCheck Endpoint
app.MapHealthChecks("/health");
```
<sup><a href='https://github.com/JasperFx/marten/blob/master/src/Marten/Events/Daemon/AsyncDaemonHealthCheckExtensions.cs#L62-L95' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_addmartenasyncdaemonhealthcheck' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace Marten.AsyncDaemon.Testing;


public class AsyncDaemonHealthCheckExtensionsTests : DaemonContext
public class AsyncDaemonHealthCheckExtensionsTests: DaemonContext
{
private FakeHealthCheckBuilderStub builder = new();

Expand Down Expand Up @@ -122,7 +122,7 @@ public async Task should_be_healty_with_all_projections_caught_up()
}

[Fact]
public async Task should_be_healty_with_one_projections_lagging()
public async Task should_be_unhealty_with_one_projection_lagging()
{
StoreOptions(x =>
{
Expand Down
4 changes: 1 addition & 3 deletions src/Marten/Events/Daemon/AsyncDaemonHealthCheckExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal record AsyncDaemonHealthCheckSettings(int MaxEventLag);
/// <summary>
/// Health check implementation
/// </summary>
internal class AsyncDaemonHealthCheck : IHealthCheck
internal class AsyncDaemonHealthCheck: IHealthCheck
{
/// <summary>
/// The <see cref="DocumentStore"/> to check health for.
Expand All @@ -59,7 +59,6 @@ internal AsyncDaemonHealthCheck(IDocumentStore store, AsyncDaemonHealthCheckSett
_store = store;
_maxEventLag = settings.MaxEventLag;
}
#region sample_addmartenasyncdaemonhealthcheck
public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context,
CancellationToken cancellationToken = default)
{
Expand Down Expand Up @@ -92,6 +91,5 @@ internal AsyncDaemonHealthCheck(IDocumentStore store, AsyncDaemonHealthCheckSett
return HealthCheckResult.Unhealthy($"Unhealthy: {ex.Message}", ex);
}
}
#endregion
}
}

0 comments on commit 4f89877

Please sign in to comment.