From a80b6a31e46345097491c22e876cd01e0705fdab Mon Sep 17 00:00:00 2001 From: Kimmo Linnavuo Date: Fri, 8 Apr 2022 15:28:06 +0300 Subject: [PATCH] Use shutil.move instead of path rename when moving discarded captures --- bin/background_indexer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/background_indexer.py b/bin/background_indexer.py index 9720774..10ac98b 100755 --- a/bin/background_indexer.py +++ b/bin/background_indexer.py @@ -3,6 +3,7 @@ import logging import os from datetime import datetime, timedelta +import shutil from lookyloo.default import AbstractManager from lookyloo.exceptions import MissingUUID, NoValidHarFile @@ -61,7 +62,7 @@ class BackgroundIndexer(AbstractManager): self.logger.warning(f'Unable to build pickle for {uuid}: {uuid_path.parent.name}') # The capture is not working, moving it away. self.lookyloo.redis.hdel('lookup_dirs', uuid) - uuid_path.parent.rename(self.discarded_captures_dir / uuid_path.parent.name) + shutil.move(uuid_path.parent, (self.discarded_captures_dir / uuid_path.parent.name)) def _check_indexes(self): index_redis = self.lookyloo.indexing.redis