Function solana_runtime::snapshot_utils::move_and_async_delete_path
source · pub fn move_and_async_delete_path(path: impl AsRef<Path> + Copy)
Expand description
Delete directories/files asynchronously to avoid blocking on it. Fist, in sync context, rename the original path to *_deleted, then spawn a thread to delete the renamed path. If the process is killed and the deleting process is not done, the leftover path will be deleted in the next process life, so there is no file space leaking.