Electric.AsyncDeleter (electric v1.4.13)
View SourceA service that batches file/directory deletions by first moving them into a
per-stack trash directory and then, after a configurable interval, removing
the trash directory contents in one rm -rf operation.
This reduces filesystem churn when many deletes happen in quick succession
(e.g. cache eviction) and avoids blocking callers: delete/1 returns after a
quick File.rename/2 into the trash directory.
Configuration:
:cleanup_interval_ms- interval in milliseconds after the first queued delete before the batch is removed. Defaults to 10000 ms.
Summary
Functions
Returns a specification to start this module under a supervisor.
Deletes the given directory by first renaming it into the stack's trash directory then asynchronously removing the trash entry using rm -rf.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec delete(Electric.stack_id(), Path.t()) :: :ok | {:error, term()}
Deletes the given directory by first renaming it into the stack's trash directory then asynchronously removing the trash entry using rm -rf.