-
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.
fix: Drop Chokidar initial scan events on stop
When stopping the Chokidar based local watcher while the initial scan of the local synchronization directory is taking place, we should drop all buffered events rather than flush them and try to process them. First, we don't really have any urgency to do so as these events will be generated during the next initial scan (when restarting the watcher once again), contrary to events emitted by the filesystem while the watcher is already running. Second, flushing and processing these events can lead to painful consequences if the scan was not complete yet since the initial scan step will consider any document not scanned yet as missing and will generate deletion events for them.
- Loading branch information
1 parent
64f169f
commit f0e128d
Showing
2 changed files
with
75 additions
and
4 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