mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-05 04:54:36 -04:00
fix(tauri): Let watcher sleep even if we fail to get current swaps
This commit is contained in:
parent
8f33fe5b41
commit
119b8714ef
1 changed files with 2 additions and 3 deletions
|
@ -43,6 +43,8 @@ impl Watcher {
|
|||
// Note: since this is de-facto a daemon, we have to gracefully handle errors
|
||||
// (which in our case means logging the error message and trying again later)
|
||||
loop {
|
||||
tokio::time::sleep(Duration::from_secs(Watcher::CHECK_INTERVAL)).await;
|
||||
|
||||
// Fetch current transactions and timelocks
|
||||
let current_swaps = match self.get_current_swaps().await {
|
||||
Ok(val) => val,
|
||||
|
@ -82,9 +84,6 @@ impl Watcher {
|
|||
// Insert new status
|
||||
self.cached_timelocks.insert(swap_id, new_timelock_status);
|
||||
}
|
||||
|
||||
// Sleep and check again later
|
||||
tokio::time::sleep(Duration::from_secs(Watcher::CHECK_INTERVAL)).await;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue