[FileIndexScheduler] Cleanup firstRun handling
ClosedPublic

Authored by bruns on Mar 7 2020, 10:44 PM.

Details

Summary

firstRun is an internal state of baloo, there is no need to write it to
the config. We can determine it from the existence of the DB file. In
case the DB is only populated partially, the remainder will be picked
up by the UnnindexedFileIndexer.

Delay the content indexing during startup. Currently, we only delay
the UnindexedFileIndexer and StaleFileIndexer, but files already flagged
for indexing would be picked up immediately.

Apply the same delay also to the initial run.

Test Plan

A) First run:
kill baloo_file manually, delete the index
start baloo_file -> 5 second delay

B) Login
kill baloo_file manually
touch some files
start baloo_file -> content indexing delayed

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Mar 7 2020, 10:44 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptMar 7 2020, 10:44 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Mar 7 2020, 10:44 PM
broulik added inline comments.
src/file/indexerstate.h
41

Indentation

src/lib/indexerconfig.cpp
112

Please mark them as deprecated in the header file

bruns updated this revision to Diff 77309.Mar 9 2020, 6:47 PM

Mark as @deprecated since 5.69
whitespace

bruns marked 2 inline comments as done.Mar 9 2020, 6:55 PM
bruns updated this revision to Diff 77580.Mar 13 2020, 4:54 PM

fix deprecation

ngraham accepted this revision.Mar 15 2020, 1:00 AM

Good stuff.

Maybe next we should make baloo_file get killed automatically when indexing is disabled. ;)

This revision is now accepted and ready to land.Mar 15 2020, 1:00 AM
bruns added a comment.Mar 15 2020, 1:08 AM

Maybe next we should make baloo_file get killed automatically when indexing is disabled. ;)

baloo_file is stopped when you disable indexing, so I don't know what you are referring to ...

This revision was automatically updated to reflect the committed changes.

Maybe next we should make baloo_file get killed automatically when indexing is disabled. ;)

baloo_file is stopped when you disable indexing, so I don't know what you are referring to ...

It's definitely better with d74d1cbb65db03a03d5fdb91681ad906e8f098f8, but the baloo_file processes don't immediately terminate. Maybe it's not a big deal.