1
Fork 0

linear backoff

This commit is contained in:
Andy Killorin 2023-12-24 09:19:57 -06:00
parent acfa1749ea
commit ebdc910a57
Signed by: ank
GPG key ID: B6241CA3B552BCA4

View file

@ -212,11 +212,16 @@ impl TurtleCommander {
}
pub async fn dock(&self) -> usize {
let mut wait = 1;
loop {
let res = Depots::dock(&self.depots, self.to_owned()).await;
if let Some(fuel) = res {
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;
}
}