-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhandled WebSocketConnectionClosedException #383
Comments
Yes handling this in the application is the preferred way. There is an 'auto_reconnect' feature built in ( |
Sorry, what I wrote was confusing. Here's what I meant: This:
is wrapped with a try-block and handles broken sockets transparently when auto_reconnect=True .
Shouldn't the same practice be applied here:
so that I don't need to reconnect manually in my application and I can simply rely on auto_reconnect doing what it promises? ;)
|
Ah I see what you mean now.. You are most likely right, now probably in case of a subscription with a long interval between responses the connection could be closed. The question is what will happen if during an active subscription the If there aren't any I can just expand the try/catch and I'll link a PR, otherwise I think it's best to move to checks to the application, so there is more control what to do with these edge cases. |
Occasionally this line:
py-substrate-interface/substrateinterface/base.py
Line 329 in 84485c1
blows up with
WebSocketConnectionClosedException
. Would it be ok to wrap it with an auto-reconnect try-catch just like here:py-substrate-interface/substrateinterface/base.py
Lines 271 to 282 in 84485c1
The text was updated successfully, but these errors were encountered: