-
Notifications
You must be signed in to change notification settings - Fork 280
Open
Labels
P1Priority 1Priority 1
Description
We are using durable functions in an isolated process with only one orchestration calling further sub-orchestrations. We have setup a timer to remove the orhcestration execution and it's history
[Function(Name)]
public async Task Run(
[TimerTrigger("0 0 0 * * 0", RunOnStartup = false)] TimerInfo myTimer,
[DurableClient] DurableTaskClient durableTaskClient)
{
logger.LogInformation("Starting orchestration history purge.");
var instances = await durableTaskClient
.GetAllInstancesAsync(new()
{
CreatedFrom = new DateTime(2000,1,1,0,0,0),
CreatedTo = DateTime.UtcNow.AddDays(-7),
Statuses =
[
OrchestrationRuntimeStatus.Completed,
OrchestrationRuntimeStatus.Failed,
OrchestrationRuntimeStatus.Terminated
]
})
.ToListAsync();
var purgeTasks = instances
.Select(instance =>
durableTaskClient.PurgeInstanceAsync(
instance.InstanceId,
new PurgeInstanceOptions(Recursive: true)));
await Task.WhenAll(purgeTasks);
}
The problem is, it deletes the instance from blob storage, so it is not accessible through GetAllInstancesAsync()
anymore, but none of the entries in the {taskHub}History
table are deleted
domasd
Metadata
Metadata
Assignees
Labels
P1Priority 1Priority 1