mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-06 13:34:38 -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
|
// 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)
|
// (which in our case means logging the error message and trying again later)
|
||||||
loop {
|
loop {
|
||||||
|
tokio::time::sleep(Duration::from_secs(Watcher::CHECK_INTERVAL)).await;
|
||||||
|
|
||||||
// Fetch current transactions and timelocks
|
// Fetch current transactions and timelocks
|
||||||
let current_swaps = match self.get_current_swaps().await {
|
let current_swaps = match self.get_current_swaps().await {
|
||||||
Ok(val) => val,
|
Ok(val) => val,
|
||||||
|
@ -82,9 +84,6 @@ impl Watcher {
|
||||||
// Insert new status
|
// Insert new status
|
||||||
self.cached_timelocks.insert(swap_id, new_timelock_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