mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-30 20:46:33 -05:00
Release swap lock after receiving shutdown signal
This commit is contained in:
parent
2c6c7b964c
commit
2634b55fc1
1 changed files with 8 additions and 2 deletions
|
|
@ -315,6 +315,7 @@ impl Request {
|
|||
biased;
|
||||
_ = context.swap_lock.listen_for_swap_force_suspension() => {
|
||||
tracing::debug!("Shutdown signal received, exiting");
|
||||
context.swap_lock.release_swap_lock().await.context("Shutdown signal received but failed to release swap lock. The swap process has been terminated but the swap lock is still active.")?;
|
||||
bail!("Shutdown signal received");
|
||||
},
|
||||
result = async {
|
||||
|
|
@ -407,7 +408,9 @@ impl Request {
|
|||
);
|
||||
|
||||
Ok((event_loop,swap))
|
||||
} => result,
|
||||
} => {
|
||||
result
|
||||
},
|
||||
};
|
||||
|
||||
let (event_loop, swap) = match initialize_swap {
|
||||
|
|
@ -428,6 +431,8 @@ impl Request {
|
|||
biased;
|
||||
_ = context.swap_lock.listen_for_swap_force_suspension() => {
|
||||
tracing::debug!("Shutdown signal received, exiting");
|
||||
context.swap_lock.release_swap_lock().await.context("Shutdown signal received but failed to release swap lock. The swap process has been terminated but the swap lock is still active.")?;
|
||||
bail!("Shutdown signal received");
|
||||
},
|
||||
_ = async {
|
||||
|
||||
|
|
@ -555,7 +560,8 @@ impl Request {
|
|||
},
|
||||
_ = context.swap_lock.listen_for_swap_force_suspension() => {
|
||||
tracing::debug!("Shutdown signal received, exiting");
|
||||
|
||||
context.swap_lock.release_swap_lock().await.context("Shutdown signal received but failed to release swap lock. The swap process has been terminated but the swap lock is still active.")?;
|
||||
bail!("Shutdown signal received");
|
||||
}
|
||||
}
|
||||
context
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue