git-watchtower 1.9.13 → 1.9.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1979,11 +1979,18 @@ async function pollGitChanges() {
1979
1979
  }
1980
1980
  }
1981
1981
 
1982
+ function schedulePoll() {
1983
+ pollIntervalId = setTimeout(async () => {
1984
+ await pollGitChanges();
1985
+ schedulePoll();
1986
+ }, store.get('adaptivePollInterval'));
1987
+ }
1988
+
1982
1989
  function restartPolling() {
1983
1990
  if (pollIntervalId) {
1984
- clearInterval(pollIntervalId);
1991
+ clearTimeout(pollIntervalId);
1985
1992
  }
1986
- pollIntervalId = setInterval(pollGitChanges, store.get('adaptivePollInterval'));
1993
+ schedulePoll();
1987
1994
  }
1988
1995
 
1989
1996
  // ============================================================================
@@ -2837,7 +2844,7 @@ async function shutdown() {
2837
2844
  }
2838
2845
 
2839
2846
  if (fileWatcher) fileWatcher.close();
2840
- if (pollIntervalId) clearInterval(pollIntervalId);
2847
+ if (pollIntervalId) clearTimeout(pollIntervalId);
2841
2848
 
2842
2849
  // Stop server based on mode
2843
2850
  if (SERVER_MODE === 'command') {
@@ -3027,8 +3034,8 @@ async function start() {
3027
3034
  render();
3028
3035
  });
3029
3036
 
3030
- // Start polling with adaptive interval
3031
- pollIntervalId = setInterval(pollGitChanges, store.get('adaptivePollInterval'));
3037
+ // Start polling with adaptive interval (setTimeout-based to avoid queuing)
3038
+ schedulePoll();
3032
3039
 
3033
3040
  // Initial render
3034
3041
  render();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.9.13",
3
+ "version": "1.9.14",
4
4
  "description": "Terminal-based Git branch monitor with activity sparklines and optional dev server with live reload",
5
5
  "main": "bin/git-watchtower.js",
6
6
  "bin": {