fixup for older rust
This commit is contained in:
parent
56d600d74b
commit
76db34a53f
|
@ -473,8 +473,11 @@ impl Api {
|
||||||
.send()
|
.send()
|
||||||
.await?
|
.await?
|
||||||
.check_json()
|
.check_json()
|
||||||
.await
|
.await;
|
||||||
.inspect_err(|e| self.circuit_breaker_trip_on_429(e));
|
|
||||||
|
if let Err(ref e) = res {
|
||||||
|
self.circuit_breaker_trip_on_429(e);
|
||||||
|
}
|
||||||
|
|
||||||
match res {
|
match res {
|
||||||
Ok(entry) => Ok(Some(entry)),
|
Ok(entry) => Ok(Some(entry)),
|
||||||
|
@ -515,10 +518,13 @@ impl Api {
|
||||||
.send()
|
.send()
|
||||||
.await?
|
.await?
|
||||||
.check_json()
|
.check_json()
|
||||||
.await
|
.await;
|
||||||
.inspect_err(|e| self.circuit_breaker_trip_on_429(e))?;
|
|
||||||
|
|
||||||
Ok(res)
|
if let Err(ref e) = res {
|
||||||
|
self.circuit_breaker_trip_on_429(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Finalizes uploading to a cache.
|
/// Finalizes uploading to a cache.
|
||||||
|
@ -534,14 +540,18 @@ impl Api {
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
self.stats.post.fetch_add(1, Ordering::SeqCst);
|
self.stats.post.fetch_add(1, Ordering::SeqCst);
|
||||||
|
|
||||||
self.client
|
if let Err(e) = self
|
||||||
|
.client
|
||||||
.post(self.construct_url(&format!("caches/{}", cache_id.0)))
|
.post(self.construct_url(&format!("caches/{}", cache_id.0)))
|
||||||
.json(&req)
|
.json(&req)
|
||||||
.send()
|
.send()
|
||||||
.await?
|
.await?
|
||||||
.check()
|
.check()
|
||||||
.await
|
.await
|
||||||
.inspect_err(|e| self.circuit_breaker_trip_on_429(e))?;
|
{
|
||||||
|
self.circuit_breaker_trip_on_429(&e);
|
||||||
|
return Err(e);
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue