-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core/local/chokidar: Run initial scan step once (#2104)
The initial scan step in the Chokidar watcher can be potentially long when a lot of documents are present in the local synchronization directory (i.e. there are many events to process). The step is run as part of the asynchronous events flushing callback and could thus potentially be run each time events are flushed. To prevent this, we mark the `initialScan` object (if it exists) as flushed at the very beginning of the flushing callback. However, the step itself does not check this attribute before processing events and so a second flush while an initial scan is being run could trigger a second initial scan run. We now check the `flushed` attribute's value before running an initial scan step and move its assignment to the step itself to co-locate it with its usage.
- Loading branch information
1 parent
b866241
commit 33a6ce8
Showing
7 changed files
with
171 additions
and
80 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.