Skip to content

Commit

Permalink
Fix disposable implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolCoderSuper committed Oct 31, 2024
1 parent 764e9c0 commit d26682f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/OllamaApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ private async Task EnsureSuccessStatusCodeAsync(HttpResponseMessage response)
/// Releases the resources used by the <see cref="OllamaApiClient"/> instance.
/// Disposes the internal HTTP client if it was created internally.
/// </summary>
public void Dispose()
public void Cleanup()
{
if (_disposeHttpClient)
_client?.Dispose();
Expand Down Expand Up @@ -424,7 +424,7 @@ async Task<GeneratedEmbeddings<Embedding<float>>> IEmbeddingGenerator<string, Em
=> key is null ? this as TService : null;

/// <inheritdoc/>
void IDisposable.Dispose() => Dispose();
public void Dispose() => Cleanup();

#endregion

Expand Down
2 changes: 1 addition & 1 deletion test/OllamaApiClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void SetUp()
[OneTimeTearDown]
public void OneTimeTearDown()
{
_client.Dispose();
_client.Cleanup();
}

/// <summary>
Expand Down

0 comments on commit d26682f

Please sign in to comment.