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

test pr #53

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cdn-client/src/retry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ impl<C: ConnectionDef> Retry<C> {
let inner = self.inner.clone();
spawn(async move {
let mut connection = inner.connection.write().await;
let mut retry_count = 0;

// Forever,
loop {
Expand All @@ -176,8 +177,10 @@ impl<C: ConnectionDef> Retry<C> {
}
Err(err) => {
// We failed to reconnect
retry_count += 1;
// Sleep for 2 seconds and then try again
error!("failed to connect: {err}");
error!("failed to connect: {err}. attempts: {retry_count}");
tokio::task::yield_now().await;
sleep(Duration::from_secs(2)).await;
}
}
Expand Down