Method CleanAsync
CleanAsync(TimeSpan, CancellationToken)
Cleans up the repository by removing files whose delete markers are older than deleteDelay.
Declaration
Task CleanAsync(TimeSpan deleteDelay, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | deleteDelay | The minimum age a delete marker must reach before its file is physically deleted. Use Zero to delete all marked files immediately. |
| CancellationToken | cancellationToken | A cancellation token that cancels the operation. |
Returns
| Type | Description |
|---|---|
| Task |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Another clean operation is already in progress. |
CleanAsync(TimeSpan, Func<FileId, IndeterminateResolution>?, CancellationToken)
Cleans up the repository by removing files whose delete markers are older than deleteDelay and resolving indeterminate files using
the provided synchronous callback.
Declaration
Task CleanAsync(TimeSpan deleteDelay, Func<FileId, IndeterminateResolution>? resolveIndeterminateCallback, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | deleteDelay | The minimum age a delete marker must reach before its file is physically deleted. Use Zero to delete all marked files immediately. |
| Func<FileId, IndeterminateResolution> | resolveIndeterminateCallback | An optional callback invoked for each indeterminate file encountered during the clean. Return Keep to clear the indeterminate state and keep the file, or Delete to mark it for deletion. |
| CancellationToken | cancellationToken | A cancellation token that cancels the operation. |
Returns
| Type | Description |
|---|---|
| Task |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Another clean operation is already in progress. |
CleanAsync(TimeSpan, Func<FileId, Task<IndeterminateResolution>>?, CancellationToken)
Cleans up the repository by removing files whose delete markers are older than deleteDelay and resolving indeterminate files using
the provided asynchronous callback.
Declaration
Task CleanAsync(TimeSpan deleteDelay, Func<FileId, Task<IndeterminateResolution>>? resolveIndeterminateCallback, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | deleteDelay | The minimum age a delete marker must reach before its file is physically deleted. Use Zero to delete all marked files immediately. |
| Func<FileId, Task<IndeterminateResolution>> | resolveIndeterminateCallback | An optional callback invoked for each indeterminate file encountered during the clean. Return Keep to clear the indeterminate state and keep the file, or Delete to mark it for deletion. |
| CancellationToken | cancellationToken | A cancellation token that cancels the operation. |
Returns
| Type | Description |
|---|---|
| Task |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Another clean operation is already in progress. |