masa-finance / masa-bittensor

Bittensor Subnet Config
https://masa.ai
MIT License
0 stars 0 forks source link

fix: server async issues #47

Closed obasilakis closed 1 month ago

obasilakis commented 1 month ago

Enhanced Server Shutdown and Event Loop Management

Overview

This PR refines the shutdown process and event loop management in the ValidatorAPI class to ensure clean exits and proper resource cleanup after server interruptions.

Changes

  1. Graceful Shutdown Handling: Implemented a try-except block to handle KeyboardInterrupt for graceful server shutdown.
  2. Event Loop Management: Added a finally block to ensure the event loop is always closed, and reset the event loop to prevent hanging processes.