forked from gitextensions/gitextensions
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit how often GitStatus polls for changes
Reported in gitextensions#4069 GE can in some situations use a lot of CPU and disk load, as it runs "git status --untracked-files" at changes in the filesystem If a status command is not done before next update is detected, the next start immediately after. "git status" can therefore run continuously. (This is more visible with certain viruses like Symantec and McAfee.) This PR limits the checks in two ways: * First run is started after 1000ms + timer (fires every 500ms so adds on average 250ms) instead of 500ms +timer, to collect more changes (probably not essential) * Next command is started minimum 3000ms after the previous command. If 3*time to run the status update is longer than 3000ms, the interval time is dynamically increased. So normal one shot changes are detected about the same as now, but continuous changes are not updating so frequently, "git status" should not run continuously. A few other changes like that the "next run" time could be overwritten by a time in the future and that retrieved "git status" data were not used if more file system changes were detected. If "git status" requires more than 5s to run, the behavior is not improved. The counter in the Commit button should not be used then. Configurable time could improve (like longest of 5s and twice the time to run git status), configurable time is not going to be used. There are situations where the "ignored files detection" is insufficient. See gitextensions#4256 for a discussion.
- Loading branch information
Showing
1 changed file
with
44 additions
and
38 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