Skip to content

Commit fbeacb6

Browse files
committed
addressed comments
1 parent c992a36 commit fbeacb6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dwds/lib/src/services/web_socket_proxy_service.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const _pauseIsolatesOnStartFlag = 'pause_isolates_on_start';
3131
/// Grace period before destroying isolate when no clients are detected.
3232
/// This handles the race condition during page refresh where the old connection
3333
/// closes before the new connection is established, preventing premature isolate destruction.
34-
const _isolateDestructionGracePeriod = Duration(seconds: 2);
34+
const _isolateDestructionGracePeriod = Duration(seconds: 10);
3535

3636
/// Tracks hot reload responses from multiple browser windows/tabs.
3737
class _HotReloadTracker {
@@ -292,8 +292,14 @@ class WebSocketProxyService extends ProxyService {
292292
// Double-check client count again before destroying
293293
final finalClientCount = sendClientRequest({'type': 'ping'});
294294
if (finalClientCount == 0) {
295+
_logger.fine(
296+
'Final check confirmed no clients, destroying isolate',
297+
);
295298
destroyIsolate();
296299
} else {
300+
_logger.fine(
301+
'Final check found $finalClientCount clients, keeping isolate alive',
302+
);
297303
_activeConnectionCount = finalClientCount;
298304
}
299305
});

0 commit comments

Comments
 (0)