Skip to content
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

feat(listener): restart ws client + refactoring #2168

Merged
merged 4 commits into from
Mar 15, 2024
Merged

Conversation

justprosh
Copy link
Member

No description provided.

@justprosh justprosh added the e2e Run e2e workflow label Mar 15, 2024
if let Err(err) = self.poll_deal_statuses().await {
tracing::warn!(target: "chain-listener", "Failed to poll deal statuses: {err}");
}
async fn refresh_subscriptions(&mut self) -> Result<(), client::Error> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recreate?

async fn refresh_subscriptions(&mut self) -> Result<(), client::Error> {
if !self.ws_client.is_connected() {
self.ws_client =
ChainListener::create_ws_client(&self.listener_config.ws_endpoint).await?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ChainListener::create_ws_client(&self.listener_config.ws_endpoint).await?;
// Ws Client creation retries through backoff inside, will fail only after many attempts
// So it is OK that its error will propagate out of the loop
ChainListener::create_ws_client(&self.listener_config.ws_endpoint).await?;

Copy link
Member

@folex folex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@folex folex merged commit ba61f15 into master Mar 15, 2024
13 of 14 checks passed
@folex folex deleted the restart_ws_client branch March 15, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants