Skip to content

Commit

Permalink
Remove CallInvoker
Browse files Browse the repository at this point in the history
  • Loading branch information
russcam committed May 8, 2024
1 parent 396f91a commit e584d65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 43 deletions.
42 changes: 0 additions & 42 deletions src/Pinecone.Grpc/PineconeCallInvoker.cs

This file was deleted.

7 changes: 6 additions & 1 deletion src/Pinecone.Grpc/PineconeChannel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Grpc.Core;
using Grpc.Core.Interceptors;
using Grpc.Net.Client;

namespace Pinecone.Grpc;
Expand All @@ -20,7 +21,11 @@ private PineconeChannel(GrpcChannel channel, string apiKey) : base(channel.Targe
}

/// <inheritdoc />
public override CallInvoker CreateCallInvoker() => new PineconeCallInvoker(_channel, _apiKey);
public override CallInvoker CreateCallInvoker() => _channel.Intercept(metadata =>
{
metadata.Add("api-key", _apiKey);
return metadata;
});

/// <summary>
/// Creates a <see cref="PineconeChannel"/> for the specified configuration and index name
Expand Down

0 comments on commit e584d65

Please sign in to comment.