Implement flush for search backend after remove command

This commit is contained in:
JDC 2020-11-19 16:45:12 -05:00 committed by Nick Sweeting
parent c2c01af3ad
commit 47daa038eb
5 changed files with 21 additions and 7 deletions

View file

@ -115,6 +115,7 @@ from .logging_util import (
printable_dependency_version,
)
from .search import flush_search_index
ALLOWED_IN_OUTPUT_DIR = {
'lost+found',
@ -665,6 +666,7 @@ def remove(filter_str: Optional[str]=None,
to_remove = snapshots.count()
remove_from_sql_main_index(snapshots=snapshots, out_dir=out_dir)
flush_search_index(snapshot_ids=[str(pk) for pk in snapshots.values_list('pk',flat=True)])
all_snapshots = load_main_index(out_dir=out_dir)
log_removal_finished(all_snapshots.count(), to_remove)