Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PackageVersion Include="Azure.Storage.Blobs" Version="12.19.1" />
<PackageVersion Include="Azure.Storage.Files.Shares" Version="12.17.1" />
<PackageVersion Include="Azure.Storage.Queues" Version="12.17.1" />
<PackageVersion Include="ClickHouse.Client" Version="7.8.2" />
<PackageVersion Include="ClickHouse.Driver" Version="0.7.20" />
<PackageVersion Include="Confluent.Kafka" Version="2.3.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="Dapr.Client" Version="1.12.0" />
Expand Down
6 changes: 3 additions & 3 deletions src/HealthChecks.ClickHouse/ClickHouseHealthCheck.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ClickHouse.Client.ADO;
using ClickHouse.Driver.ADO;
using Microsoft.Extensions.Diagnostics.HealthChecks;

namespace HealthChecks.ClickHouse;
Expand Down Expand Up @@ -26,10 +26,10 @@ public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context
{
await _connection.OpenAsync(cancellationToken).ConfigureAwait(false);

using var command = _connection.CreateCommand();
await using var command = _connection.CreateCommand();
command.CommandText = _command;

await command.ExecuteScalarAsync(cancellationToken).ConfigureAwait(false);
_ = await command.ExecuteScalarAsync(cancellationToken).ConfigureAwait(false);

return HealthCheckResult.Healthy();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ClickHouse.Client.ADO;
using ClickHouse.Driver.ADO;
using HealthChecks.ClickHouse;
using Microsoft.Extensions.Diagnostics.HealthChecks;

Expand Down
2 changes: 1 addition & 1 deletion src/HealthChecks.ClickHouse/HealthChecks.ClickHouse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClickHouse.Client" />
<PackageReference Include="ClickHouse.Driver" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/HealthChecks.ClickHouse/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## ClickHouse Health Check

This health check verifies the ability to communicate with [ClickHouse](https://www.clickhouse.com/). It uses the [ClickHouse.Client](https://www.nuget.org/packages/ClickHouse.Client) library.
This health check verifies the ability to communicate with [ClickHouse](https://www.clickhouse.com/). It uses the [ClickHouse.Driver](https://www.nuget.org/packages/ClickHouse.Driver) library.

## Recommended approach

When registering the ClickHouse health check, it is [recommended](https://github.com/DarkWanderer/ClickHouse.Client/wiki/Connection-lifetime-&-pooling#recommendations) to use `IHttpClientFactory` or a static instance of `HttpClient` to manage connections.
When registering the ClickHouse health check, it is recommended to use `IHttpClientFactory` or a static instance of `HttpClient` to manage connections.

```csharp
void Configure(IServiceCollection services)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ClickHouse.Client.ADO;
using ClickHouse.Driver.ADO;

namespace HealthChecks.ClickHouse.Tests.DependencyInjection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Net;
using ClickHouse.Client.ADO;
using ClickHouse.Driver.ADO;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;

Expand Down