refactor: library scanning - #1495
Open
TrigamDev wants to merge 4 commits into
Open
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.
Summary
refresh_dir(), which consumes the files produced by which ever scanner is used.scan_for_files(). This way, any function that needs to scan for files can just blindly callscan_for_files()without needing to determine which scanner should be used, and it will receive an iterator of files.wcmatchscanner to simply "internal". This better reflects its purpose, and helps if the implementation of the internal scanner ever changes down the line.scan_for_files()) static, as they don't rely on any attributes ofRefreshTracker.Notes
ignore_to_glob()produces a lot of redundant, recursive patterns that slow down the internal scanner so much that it's quite literally unusable on my primary library (~65k files, with a large ignore file). I was never able to get it to produce any output on my primary library. It may be worth looking into improving the translation from gitignore-style to glob, or replacing the internal scanner implementation altogether.refresh_dir()emit more detailed progress, rather than just anint.refresh_dir()is set to only emit output every 1/30th of a second.refresh_dir()is the one responsible for enforcing this limit? At least to me personally, it'd make more sense to place the responsibility on the UI for limiting the rate of UI updates. Especially if another, rapidly-updating data source were connected to a progress UI.Tasks Completed