Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Oct 25, 2023
1 parent d9fb049 commit 77a9b99
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 8 additions & 3 deletions crates/erc20_payment_lib/src/sender/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,10 @@ pub async fn process_transactions(
}
}

tokio::time::sleep(std::time::Duration::from_secs(payment_setup.process_interval)).await;
tokio::time::sleep(std::time::Duration::from_secs(
payment_setup.process_interval,
))
.await;
}
Ok(())
}
Expand Down Expand Up @@ -407,8 +410,10 @@ pub async fn service_loop(
Ok(token_transfer_map) => token_transfer_map,
Err(e) => {
log::error!("Error in gather transactions, driver will be stuck, Fix DB to continue {:?}", e);
tokio::time::sleep(std::time::Duration::from_secs(payment_setup.process_interval))
.await;
tokio::time::sleep(std::time::Duration::from_secs(
payment_setup.process_interval,
))
.await;
continue;
}
};
Expand Down
5 changes: 4 additions & 1 deletion crates/erc20_payment_lib/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ pub async fn confirm_loop(
payment_setup: &PaymentSetup,
) {
loop {
tokio::time::sleep(std::time::Duration::from_secs(payment_setup.process_interval)).await;
tokio::time::sleep(std::time::Duration::from_secs(
payment_setup.process_interval,
))
.await;
}
}

0 comments on commit 77a9b99

Please sign in to comment.