Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join the recovery threads. #284

Open
mojoX911 opened this issue Oct 19, 2024 · 0 comments
Open

Join the recovery threads. #284

mojoX911 opened this issue Oct 19, 2024 · 0 comments
Labels
enhancement This enhances the code and improves stuffs
Milestone

Comments

@mojoX911
Copy link

Problem

In the Maker server, we sometimes launch the recovery thread. But we don't join them after completion. They should be joined.

Ex:

coinswap/src/maker/api.rs

Lines 478 to 483 in bab9614

std::thread::spawn(move || {
recover_from_swap(maker_clone, outgoings, incomings).unwrap();
});
// Clear the state value here
*connection_state = ConnectionState::default();
break;

Approach.

  • Make a globally accessible thread pool in the Maker struct definition.
  • Add the recovery thread as well as all other thread in this thread pool.
  • Join all the threads from this pool at shutdown.
@mojoX911 mojoX911 added the enhancement This enhances the code and improves stuffs label Oct 19, 2024
@mojoX911 mojoX911 added this to the v0.1.1 milestone Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This enhances the code and improves stuffs
Projects
Status: No status
Development

No branches or pull requests

1 participant