-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix: implementing retrying_publish
wrapper for the relay client
#124
Conversation
0d62c8e
to
d5a368a
Compare
I don't like how connection is duplicated twice and this should be refactored according to DRY, but that can be a follow-up. |
d5a368a
to
68e2c46
Compare
.await | ||
{ | ||
warn!("Reconnecting after an error in publishing message: {}", e); | ||
while let Err(e) = client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this conflict with the retry loop in websocket_service?
ttl: Duration, | ||
prompt: bool, | ||
) -> Result<()> { | ||
if let Err(e) = client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to get the type of error. Not all errors are disconnect related
To handle properly with coming updates in #127 this implementation should be changed.
What do you think, @chris13524 ? |
Closing this PR in a favor of #128 128 |
Description
This PR introduces retrying_publish function which wraps the current relay client
.publish
method and adds additional retrying and client reconnection logic to the current publishing mechanism:The
client.publish
is replaced with the new function in websocket message handlers.Resolves #74
How Has This Been Tested?
It should be tested by the current integration testing because the new function replaces the
.publish
which is indirectly used in the tests.Due Diligence