When a note is being edited by the user, every keystroke can trigger a file update event on the watcher. In the worse-case, this results in the creation of individual sync events per each keystroke, which is unnecessary and could event lead to Github API quota exhaustion. To prevent this, implement delayed sync in the following manner.
Start a timer when an edit on a note has been started
Add the updated note to the sync queue only when the timer is expired
If a file change is detected (another update) on the same file before the timer is expired, reset the timer.
When a note is being edited by the user, every keystroke can trigger a file update event on the watcher. In the worse-case, this results in the creation of individual sync events per each keystroke, which is unnecessary and could event lead to Github API quota exhaustion. To prevent this, implement delayed sync in the following manner.