Automatic indexing of un-indexed files (#1039)

* Downgrade rebuild index dialog from warning to info
* Don't flag index as broken if file is missing, just add it again
* Fix log warning
* Drop the return value in the index checker
This commit is contained in:
Veronica Berglyd Olsen
2022-04-16 17:28:28 +02:00
committed by GitHub
parent b642e4437e
commit 17c56440f2
2 changed files with 11 additions and 9 deletions
+10 -8
View File
@@ -681,16 +681,18 @@ class NWIndex():
logException()
self._indexBroken = True
# Check that project files are indexed
for fHandle in self.theProject.projFiles:
if fHandle not in self._fileMeta:
self._indexBroken = True
break
logger.verbose("Index check completed in %.3f ms", (time() - tStart)*1000)
if self._indexBroken:
self.clearIndex()
logger.verbose("Index check completed in %.3f ms", (time() - tStart)*1000)
return
# If the index was ok, we check that project files are indexed
for fHandle in self.theProject.projFiles:
if fHandle not in self._fileMeta:
logger.warning("Item '%s' is not in the index", fHandle)
self.reIndexHandle(fHandle)
logger.verbose("Index check completed in %.3f ms", (time() - tStart)*1000)
return