Update WebSocket configuration and enhance connection handling in WalletWebSocketService
- Increased reconnect delay from 1 second to 2 seconds and reduced max reconnect attempts from 5 to 3 to minimize server load. - Improved logging messages for connection status and abnormal closures, providing clearer insights during reconnection attempts. - Added a ping mechanism to test connection stability and handle network connectivity issues more effectively. These changes enhance the reliability and performance of the WebSocket service, contributing to a better user experience.
This commit is contained in:
parent
6a1e70303d
commit
15a7540515
2 changed files with 53 additions and 10 deletions
|
|
@ -77,8 +77,8 @@ export const appConfig: AppConfig = {
|
|||
},
|
||||
websocket: {
|
||||
enabled: import.meta.env.VITE_WEBSOCKET_ENABLED !== 'false', // Can be disabled via env var
|
||||
reconnectDelay: 1000, // 1 second
|
||||
maxReconnectAttempts: 5
|
||||
reconnectDelay: 2000, // 2 seconds (increased from 1s to reduce server load)
|
||||
maxReconnectAttempts: 3 // Reduced from 5 to avoid overwhelming server
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue