job.paths hadn't been set yet

This commit is contained in:
Darryl Nixon 2023-07-16 14:01:44 -07:00
parent 00ad322c58
commit 737822fd99

View file

@ -27,6 +27,9 @@ async def main(job: argparse.Namespace) -> bool:
raise TypeError(f"Not a file or directory: {path}")
new_paths = set(await asyncio.gather(*tasks))
# Try to delete hardlinks based on the filesystem type
job.paths = await get_all_hardlinks(new_paths)
# Shred all physical files including hardlinks
for path in job.paths:
tasks = []
@ -40,9 +43,6 @@ async def main(job: argparse.Namespace) -> bool:
if e:
logger.warning(f"Error raised while shredding: {e}")
# Try to delete hardlinks based on the filesystem type
job.paths = await get_all_hardlinks(new_paths)
# Just in case, use "find" to delete any remaining hardlinks
# from the mount point, so let's build a map of inodes to mount points
logger.info("Deleting remaining hardlinks using find")