Diffusion Baloo 0a154d1470f1

[indexcleaner] Avoid removing included folders below excluded ones

Authored by bruns on Apr 6 2019, 11:11 PM.

Description

[indexcleaner] Avoid removing included folders below excluded ones

Summary:
This fixes a regression introduced with commit e58804bf9eb8
("React to config updates inside indexer").

The recursion should stop when it reaches an explicitly included folder,
thus pass shouldDelete also into the iteration for excluded folders.
The current unconditional removal causes recurrent indexing of included
subtrees on each login.

Do a depth first walk, and after returning check if there are any
children left. Only delete the folder if it is empty. Otherwise, the
directory tree structure has dangling subtrees.

Test Plan:
configure an includeFolder below an excludeFolder
start balooctl monitor
restart baloo_file
files below the includeFolder should not be needed to be reindexed

Reviewers: Baloo, Frameworks, ngraham, astippich, poboiko

Reviewed By: Baloo, ngraham

Subscribers: kde-frameworks-devel

Tags: Frameworks, Baloo

Differential Revision: https://phabricator.kde.org/D20299

Details

Committed
brunsApr 6 2019, 11:11 PM
Reviewer
Baloo
Differential Revision
D20299: [indexcleaner] Avoid removing included folders below excluded ones
Parents
R293:55fb8db5e227: [MTimeDB] Add some tests which include a 0 mtime
Branches
Unknown
Tags
Unknown