mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-07-16 08:55:04 +00:00
fix
This commit is contained in:
parent
58c5724392
commit
7573415597
1 changed files with 3 additions and 3 deletions
|
@ -50,7 +50,7 @@ impl Connection {
|
||||||
path: &Path,
|
path: &Path,
|
||||||
config: ConnectionConfig,
|
config: ConnectionConfig,
|
||||||
) -> Result<Box<dyn ConnectionTrait>> {
|
) -> Result<Box<dyn ConnectionTrait>> {
|
||||||
let mut current_delay = config.initial_delay_ms;
|
let mut current_delay = u64::from(config.initial_delay_ms);
|
||||||
let mut last_error = None;
|
let mut last_error = None;
|
||||||
|
|
||||||
for attempt in 0..config.max_retries {
|
for attempt in 0..config.max_retries {
|
||||||
|
@ -69,8 +69,8 @@ impl Connection {
|
||||||
if attempt < config.max_retries - 1 {
|
if attempt < config.max_retries - 1 {
|
||||||
tokio::time::sleep(Duration::from_millis(current_delay)).await;
|
tokio::time::sleep(Duration::from_millis(current_delay)).await;
|
||||||
|
|
||||||
current_delay = ((current_delay as f64 * config.backoff_factor) as u64)
|
current_delay = ((current_delay as f32 * config.backoff_factor) as u64)
|
||||||
.min(config.max_delay_ms);
|
.min(u64::from(config.max_delay_ms));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue