Class FileRepoCleaner
Cleans up a file repository: enumerates marker files in the repository's cleanup directory, removes files whose delete markers have aged past the supplied delete delay, and resolves indeterminate files via an optional caller-supplied callback.
Implements
Namespace: FulcrumFS
Assembly: FulcrumFS.dll
Syntax
public class FileRepoCleaner : IFileRepoCleaner
Remarks
A FileRepoCleaner does not require an active FileRepo and can be used to clean a repository from a separate process or scheduled task.
The repository must already be initialized; the cleaner does not create or repair repository structure. Cross-process safety is provided by file-system
primitives: indeterminate markers held open by active transactions are detected via an exclusive-share probe, and concurrent clean operations against the
same repository are serialized by an exclusive lock file inside the cleanup directory.
Constructors
| Name | Description |
|---|---|
| FileRepoCleaner(FileRepoCleaningOptions) | Initializes a new instance of the FileRepoCleaner class with the specified options. |
| FileRepoCleaner(IOptions<FileRepoCleaningOptions>) | Initializes a new instance of the FileRepoCleaner class with the specified options. |
| FileRepoCleaner(IAbsoluteDirectoryPath, Action<FileRepoCleaningOptions>?) | Initializes a new instance of the FileRepoCleaner class with the specified base directory and optional configuration action. |
Properties
| Name | Description |
|---|---|
| Options | Gets the configuration options for the cleaner. The returned instance is frozen and cannot be modified. |
Methods
| Name | Description |
|---|---|
| CleanAsync(TimeSpan, Func<FileId, IndeterminateResolution>?, CancellationToken) | Cleans up the repository by removing files whose delete markers are older than |
| CleanAsync(TimeSpan, Func<FileId, Task<IndeterminateResolution>>?, CancellationToken) | Cleans up the repository by removing files whose delete markers are older than |
| CleanAsync(TimeSpan, CancellationToken) | Cleans up the repository by removing files whose delete markers are older than |