Skip to content

Commit 029fdbb

Browse files
authored
fix(hmr): reset reconnect count when connection is established (#6047)
1 parent ada844f commit 029fdbb

File tree

1 file changed

+3
-0
lines changed
  • packages/core/src/client

1 file changed

+3
-0
lines changed

packages/core/src/client/hmr.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ function onOpen() {
154154
// Notify users that the WebSocket has successfully connected.
155155
console.info('[rsbuild] WebSocket connected.');
156156

157+
// Reset reconnect count
158+
reconnectCount = 0;
159+
157160
// To prevent WebSocket timeouts caused by proxies (e.g., nginx, docker),
158161
// send a periodic ping message to keep the connection alive.
159162
pingIntervalId = setInterval(() => {

0 commit comments

Comments
 (0)