linear backoff
This commit is contained in:
parent
acfa1749ea
commit
ebdc910a57
1 changed files with 5 additions and 0 deletions
|
@ -212,11 +212,16 @@ impl TurtleCommander {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn dock(&self) -> usize {
|
pub async fn dock(&self) -> usize {
|
||||||
|
let mut wait = 1;
|
||||||
loop {
|
loop {
|
||||||
let res = Depots::dock(&self.depots, self.to_owned()).await;
|
let res = Depots::dock(&self.depots, self.to_owned()).await;
|
||||||
if let Some(fuel) = res {
|
if let Some(fuel) = res {
|
||||||
return fuel;
|
return fuel;
|
||||||
}
|
}
|
||||||
|
// this is a poor way to do this, but I feel like select! ing on 30 different things
|
||||||
|
// would be harder
|
||||||
|
tokio::time::sleep(Duration::from_millis(wait)).await;
|
||||||
|
wait += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue