Use TimeToLive (TimeSpan?) instead of TtlMs (long?) in public APIs (#1644)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: PranavSenthilnathan <12225508+PranavSenthilnathan@users.noreply.github.com>
Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
Co-authored-by: Pranav Senthilnathan <pranas@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Copilot 2026-06-23 09:12:15 -07:00 • committed by GitHub
commit 3368bb7349
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 85 deletions

View file

@ -55,13 +55,13 @@ public class InMemoryMcpTaskStoreTests
}
[Fact]
public async Task CreateTaskAsync_UsesDefaultTtl()
public async Task CreateTaskAsync_UsesDefaultTimeToLive()
{
var store = new InMemoryMcpTaskStore { DefaultTtlMs = 30000 };
var store = new InMemoryMcpTaskStore { DefaultTimeToLive = TimeSpan.FromSeconds(30) };
var result = await store.CreateTaskAsync(CT);
Assert.Equal(30000, result.TtlMs);
Assert.Equal(TimeSpan.FromSeconds(30), result.TimeToLive);
}
[Fact]

View file

@ -34,7 +34,7 @@ public class TaskCancellationIntegrationTests : ClientServerTestBase
options.TaskStore = new InMemoryMcpTaskStore
{
DefaultPollIntervalMs = 50,
DefaultTtlMs = 5000,
DefaultTimeToLive = TimeSpan.FromSeconds(5),
};
});