mirror of https://github.com/CIRCL/lookyloo
chg: Update index right after archiving
parent
8c707b364f
commit
ae484cc14f
|
@ -44,11 +44,13 @@ class Archiver(AbstractManager):
|
||||||
self.logger.warning('Shutdown requested, breaking.')
|
self.logger.warning('Shutdown requested, breaking.')
|
||||||
break
|
break
|
||||||
archiving_done = self._archive()
|
archiving_done = self._archive()
|
||||||
self._update_all_capture_indexes()
|
|
||||||
self._load_indexes()
|
self._load_indexes()
|
||||||
# The HARs are supposedly all compressed so this call shouldn't be required
|
# The HARs are supposedly all compressed so this call shouldn't be required
|
||||||
# unless you're processing old captures for the first time.
|
# unless you're processing old captures for the first time.
|
||||||
# self._compress_hars()
|
# self._compress_hars()
|
||||||
|
if not self.shutdown_requested():
|
||||||
|
# This call takes a very long time on MinIO
|
||||||
|
self._update_all_capture_indexes()
|
||||||
|
|
||||||
def _update_index(self, root_dir: Path) -> None:
|
def _update_index(self, root_dir: Path) -> None:
|
||||||
current_index: Dict[str, str] = {}
|
current_index: Dict[str, str] = {}
|
||||||
|
@ -224,6 +226,13 @@ class Archiver(AbstractManager):
|
||||||
(capture_path / 'tree.pickle').unlink(missing_ok=True)
|
(capture_path / 'tree.pickle').unlink(missing_ok=True)
|
||||||
(capture_path / 'tree.pickle.gz').unlink(missing_ok=True)
|
(capture_path / 'tree.pickle.gz').unlink(missing_ok=True)
|
||||||
shutil.move(str(capture_path), str(dest_dir))
|
shutil.move(str(capture_path), str(dest_dir))
|
||||||
|
if captures:
|
||||||
|
# we archived some captures, update relevant index
|
||||||
|
self._update_index(captures[0].parent)
|
||||||
|
if not archiving_done:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
break
|
||||||
p.execute()
|
p.execute()
|
||||||
if archiving_done:
|
if archiving_done:
|
||||||
self.logger.info('Archiving done.')
|
self.logger.info('Archiving done.')
|
||||||
|
|
Loading…
Reference in New Issue