Method CleanAsync
CleanAsync(TimeSpan, CancellationToken)
Cleans up the repository by removing files whose delete markers are older than deleteDelay.
Declaration
public Task CleanAsync(TimeSpan deleteDelay, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | deleteDelay | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
Implements
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Another clean operation is already in progress, or the repository was opened read-only. |
| TimeoutException | The repository could not be initialized within MaxAccessWaitOrRetryTime, for example because it has not been created (call EnsureCreated() first); the inner exception says why. |
| IOException | A committed delete journal is damaged, or processing a file failed with an unexpected I/O error. The pass carries on with everything else and throws once it has finished: a damaged journal is left in place without deleting the files it lists and is named in the message, and a file that failed is left for the next pass. |
| AggregateException | More than one such failure occurred in the pass. The inner exceptions are the individual failures. |
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
public Task CleanAsync(TimeSpan deleteDelay, Func<FileId, IndeterminateResolution>? resolveIndeterminateCallback, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | deleteDelay | |
| Func<FileId, IndeterminateResolution> | resolveIndeterminateCallback | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
Implements
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Another clean operation is already in progress, or the repository was opened read-only. |
| TimeoutException | The repository could not be initialized within MaxAccessWaitOrRetryTime, for example because it has not been created (call EnsureCreated() first); the inner exception says why. |
| IOException | A committed delete journal is damaged, or processing a file failed with an unexpected I/O error. The pass carries on with everything else and throws once it has finished: a damaged journal is left in place without deleting the files it lists and is named in the message, and a file that failed is left for the next pass. |
| AggregateException | More than one such failure occurred in the pass. The inner exceptions are the individual failures. |
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
public Task CleanAsync(TimeSpan deleteDelay, Func<FileId, Task<IndeterminateResolution>>? resolveIndeterminateCallback, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | deleteDelay | |
| Func<FileId, Task<IndeterminateResolution>> | resolveIndeterminateCallback | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
Implements
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Another clean operation is already in progress, or the repository was opened read-only. |
| TimeoutException | The repository could not be initialized within MaxAccessWaitOrRetryTime, for example because it has not been created (call EnsureCreated() first); the inner exception says why. |
| IOException | A committed delete journal is damaged, or processing a file failed with an unexpected I/O error. The pass carries on with everything else and throws once it has finished: a damaged journal is left in place without deleting the files it lists and is named in the message, and a file that failed is left for the next pass. |
| AggregateException | More than one such failure occurred in the pass. The inner exceptions are the individual failures. |