git-watchtower 2.1.12 → 2.1.13

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "2.1.12",
3
+ "version": "2.1.13",
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": {
package/src/server/web.js CHANGED
@@ -564,7 +564,14 @@ class WebDashboardServer {
564
564
  try {
565
565
  client.write(message);
566
566
  } catch (e) {
567
- // Dead clientwill be cleaned up on 'close'
567
+ // Write failedproactively prune the dead client instead of
568
+ // waiting for req.on('close') to fire. On abrupt socket resets
569
+ // 'close' can be delayed long enough that subsequent frames
570
+ // hit the same failed write, accumulating exception work and
571
+ // keeping clientCount misleadingly high. Set.delete during
572
+ // iteration is safe; the for-of iterator handles it.
573
+ try { client.end(); } catch (_) { /* already torn down */ }
574
+ this.clients.delete(client);
568
575
  }
569
576
  }
570
577
  }