Repository navigation
fix: stop walking a folder for wiki links once the index is full - #181
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stops the vault walk once its index is full. Until now it went on reading every folder below, which
MAX_FILESis there to prevent.What a user sees differently: following a wiki link, or showing a wiki-embedded image, from a note outside any vault in a big folder such as
~or/resolves sooner. Before, smd listed every folder under that root before it answered, even after it had its 50,000 files. Now it stops reading folders as soon as the index is full. The index is the same: the same files are found, and the same ones are left out. Notes inside a normal vault, with fewer files than the limit, are not affected.How:
index_fileschecks, before it reads each folder, whether it already hasmaxfiles, and stops if so. The doc comment says so.Test:
the_walk_stops_once_the_index_is_fullusesmax = 2and a vault with two notes at the top and more in folders below. It checks that two files are indexed and that only one folder was read. It failed before this change (4 folders read) and passes now.cargo-mutants on
index_files|Vault::index: 24 mutants, all caught.Follows the refactor in #179.