Skip to content

Commit

Permalink
Removed unused Gprc channel property
Browse files Browse the repository at this point in the history
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
  • Loading branch information
WhitWaldo committed Sep 13, 2024
1 parent 52ded7d commit ae083f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Dapr.Jobs/DaprJobsClientBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public override DaprJobsClient Build()
var client = new Autogenerated.Dapr.DaprClient(daprClientDependencies.channel);
var apiTokenHeader = this.DaprApiToken is not null ? DaprJobsClient.GetDaprApiTokenHeader(this.DaprApiToken) : null;

return new DaprJobsGrpcClient(daprClientDependencies.channel, client, daprClientDependencies.httpClient, apiTokenHeader);
return new DaprJobsGrpcClient(client, daprClientDependencies.httpClient, apiTokenHeader);
}
}
13 changes: 7 additions & 6 deletions src/Dapr.Jobs/DaprJobsGrpcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using Grpc.Core;
using Grpc.Net.Client;
using Autogenerated = Dapr.Client.Autogen.Grpc.v1;

namespace Dapr.Jobs;
Expand All @@ -27,24 +26,27 @@ namespace Dapr.Jobs;
/// </summary>
internal sealed class DaprJobsGrpcClient : DaprJobsClient
{
/// <summary>
/// Present only for testing purposes.
/// </summary>
internal readonly HttpClient httpClient;

private readonly GrpcChannel channel;
private readonly Autogenerated.Dapr.DaprClient client;
/// <summary>
/// Used to populate options headers with API token value.
/// </summary>
internal readonly KeyValuePair<string, string>? apiTokenHeader;

private readonly Autogenerated.Dapr.DaprClient client;
private readonly string userAgent = UserAgent().ToString();

// property exposed for testing purposes
internal Autogenerated.Dapr.DaprClient Client => client;

internal DaprJobsGrpcClient(
GrpcChannel channel,
Autogenerated.Dapr.DaprClient innerClient,
HttpClient httpClient,
KeyValuePair<string, string>? apiTokenHeader)
{
this.channel = channel;
this.client = innerClient;
this.httpClient = httpClient;
this.apiTokenHeader = apiTokenHeader;
Expand Down Expand Up @@ -274,7 +276,6 @@ protected override void Dispose(bool disposing)
{
if (disposing)
{
this.channel.Dispose();
this.httpClient.Dispose();
}
}
Expand Down

0 comments on commit ae083f4

Please sign in to comment.