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

View file

@ -32,9 +32,9 @@ public class InMemoryMcpTaskStore : IMcpTaskStore
public long DefaultPollIntervalMs { get; set; } = 1000;
/// <summary>
/// Gets or sets the default time-to-live in milliseconds for new tasks, or <see langword="null"/> for unlimited.
/// Gets or sets the default time-to-live for new tasks, or <see langword="null"/> for unlimited.
/// </summary>
public long? DefaultTtlMs { get; set; }
public TimeSpan? DefaultTimeToLive { get; set; }
/// <inheritdoc/>
public Task<McpTaskInfo> CreateTaskAsync(CancellationToken cancellationToken = default)
@ -42,7 +42,7 @@ public class InMemoryMcpTaskStore : IMcpTaskStore
var taskId = Guid.NewGuid().ToString("N");
var now = DateTimeOffset.UtcNow;
var info = new McpTaskInfo(taskId, McpTaskStatus.Working, now, now, DefaultTtlMs, DefaultPollIntervalMs);
var info = new McpTaskInfo(taskId, McpTaskStatus.Working, now, now, DefaultTimeToLive, DefaultPollIntervalMs);
_tasks[taskId] = info;
return Task.FromResult(info);