Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Client/Core/PurgeInstancesFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@
DateTimeOffset? CreatedTo = null,
IEnumerable<OrchestrationRuntimeStatus>? Statuses = null)
{
/// <summary>
/// Gets or sets the maximum amount of time to spend purging instances in a single call.
/// If <c>null</c> (default), all matching instances are purged with no time limit.
/// When set, the purge stops accepting new instances after this duration elapses
/// and returns with <see cref="PurgeResult.IsComplete"/> set to <c>false</c>.
/// Already-started instance deletions will complete before the method returns.
Comment thread
YunchuWang marked this conversation as resolved.
Outdated
/// </summary>
public TimeSpan? Timeout { get; init; }

Check warning on line 24 in src/Client/Core/PurgeInstancesFilter.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The property's documentation summary text should begin with: 'Gets' (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1623.md)

Check warning on line 24 in src/Client/Core/PurgeInstancesFilter.cs

View workflow job for this annotation

GitHub Actions / smoke-tests

The property's documentation summary text should begin with: 'Gets' (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1623.md)

Check warning on line 24 in src/Client/Core/PurgeInstancesFilter.cs

View workflow job for this annotation

GitHub Actions / build

The property's documentation summary text should begin with: 'Gets' (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1623.md)
}
5 changes: 5 additions & 0 deletions src/Client/Grpc/GrpcDurableTaskClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,11 @@ public override Task<PurgeResult> PurgeAllInstancesAsync(
request.PurgeInstanceFilter.RuntimeStatus.AddRange(filter.Statuses.Select(x => x.ToGrpcStatus()));
}

if (filter?.Timeout is not null)
{
request.PurgeInstanceFilter.Timeout = Google.Protobuf.WellKnownTypes.Duration.FromTimeSpan(filter.Timeout.Value);
Comment thread
YunchuWang marked this conversation as resolved.
}
Comment thread
YunchuWang marked this conversation as resolved.
Comment thread
YunchuWang marked this conversation as resolved.

return this.PurgeInstancesCoreAsync(request, cancellation);
}

Expand Down
1 change: 1 addition & 0 deletions src/Grpc/orchestrator_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ message PurgeInstanceFilter {
google.protobuf.Timestamp createdTimeFrom = 1;
google.protobuf.Timestamp createdTimeTo = 2;
repeated OrchestrationStatus runtimeStatus = 3;
google.protobuf.Duration timeout = 4;
Comment thread
YunchuWang marked this conversation as resolved.
}

message PurgeInstancesResponse {
Expand Down
Loading