Electric.AsyncDeleter (electric v1.2.4)
View SourceA GenServer 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 a file or directory using rm -rf. Returns {:ok, output} on success or {:error, reason} on failure.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Deletes a file or directory using rm -rf. Returns {:ok, output} on success or {:error, reason} on failure.