arades79 / hyperdome

the safest place to reach out
Other
27 stars 1 forks source link

Threading clean exit #107

Closed arades79 closed 3 years ago

arades79 commented 3 years ago

Summary

This PR reworks app initialization and main functions to be more resilient to errors.

The server initialization was refactored slightly to remove a magic wait, by moving some initialization to main thread with results injected into the thread before daemonizing.

The client was inadvertently spawning the entire flask application and holding a reference to it through its life cycle. This occasionally was a cause for odd error messages during startup and shutdown because the client was holding sockets and resources that conflicted with the server. This PR removes this initialization completely from the client such that it is totally decoupled, and there is no longer any resource contention.

This closes #87

Checklist