mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-12-26 16:09:41 -05:00
Merge #305
305: Disable `backoff`s `max_elapsed_time` functionality r=da-kami a=thomaseizinger This config setting makes backoff stop retrying if we didn't get an error within this timeframe. For us, this results in backoff not actually doing anything. The connection to kraken is very long-running. It might be active for hours without failing. However, the default value for `max_elapsed_time` is set to 15 minutes. As such, once the connection fails any time after that, backoff doesn't actually retry the operation but just gives up. Fixes #303. Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This commit is contained in:
commit
b956f366b9
@ -15,8 +15,16 @@ pub fn connect() -> Result<RateUpdateStream> {
|
||||
let rate_update = Arc::new(rate_update);
|
||||
|
||||
tokio::spawn(async move {
|
||||
// The default backoff config is fine for us apart from one thing:
|
||||
// `max_elapsed_time`. If we don't get an error within this timeframe,
|
||||
// backoff won't actually retry the operation.
|
||||
let backoff = backoff::ExponentialBackoff {
|
||||
max_elapsed_time: None,
|
||||
..backoff::ExponentialBackoff::default()
|
||||
};
|
||||
|
||||
let result = backoff::future::retry_notify::<Infallible, _, _, _, _, _>(
|
||||
backoff::ExponentialBackoff::default(),
|
||||
backoff,
|
||||
|| {
|
||||
let rate_update = rate_update.clone();
|
||||
async move {
|
||||
|
Loading…
Reference in New Issue
Block a user