-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WaitFor for Qdrant #5767
base: main
Are you sure you want to change the base?
WaitFor for Qdrant #5767
Conversation
ConnectionString = connectionString | ||
}; | ||
|
||
if (connectionBuilder.ContainsKey("Endpoint") && Uri.TryCreate(connectionBuilder["Endpoint"].ToString(), UriKind.Absolute, out var serviceUri)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this hasn't been done anywhere else but maybe we could start using TryGetValue
to save a lookup. Aspire will be so much faster after that ;)
if (connectionBuilder.ContainsKey("Endpoint") && Uri.TryCreate(connectionBuilder["Endpoint"].ToString(), UriKind.Absolute, out var serviceUri)) | |
if (connectionBuilder.TryGetValue("Endpoint", out var endpoint) && Uri.TryCreate(endpoint.ToString(), UriKind.Absolute, out var serviceUri)) |
var factory = sp.GetRequiredService<IHttpClientFactory>(); | ||
var client = factory.CreateClient(); | ||
client.BaseAddress = endpoint; | ||
if (key is not null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it technically possible that this client has any default headers coming from other configuration?
if (key is not null) | |
if (key is not null && !client.DefaultRequestHeaders.Contains("Api-Key")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used named clients, so we don't need this.
Digging a little more into the builder.Services.AddHttpClient(
"qdrant-healthchecks",
client =>
{
// Set the base address of the named client.
client.BaseAddress = ...;
client.DefaultRequestHeaders.Add("Api-Key", ...)
}); |
Description
Adds
WaitFor
support for QdrantRelated: #5645
Checklist
<remarks />
and<code />
elements on your triple slash comments?Microsoft Reviewers: Open in CodeFlow