apirrone
commited on
Commit
·
effa975
1
Parent(s):
fb999d3
cleanup
Browse files
src/reachy_mini_conversation_app/main.py
CHANGED
|
@@ -122,7 +122,8 @@ def run(args, robot=None, app_stop_event=None):
|
|
| 122 |
|
| 123 |
def poll_stop_event():
|
| 124 |
"""Poll the stop event to allow graceful shutdown."""
|
| 125 |
-
while app_stop_event.is_set():
|
|
|
|
| 126 |
time.sleep(0.1)
|
| 127 |
|
| 128 |
logger.info("App stop event detected, shutting down...")
|
|
@@ -130,7 +131,7 @@ def run(args, robot=None, app_stop_event=None):
|
|
| 130 |
stream_manager.close()
|
| 131 |
except Exception as e:
|
| 132 |
logger.error(f"Error while closing stream manager: {e}")
|
| 133 |
-
|
| 134 |
if app_stop_event:
|
| 135 |
threading.Thread(target=poll_stop_event, daemon=True).start()
|
| 136 |
|
|
|
|
| 122 |
|
| 123 |
def poll_stop_event():
|
| 124 |
"""Poll the stop event to allow graceful shutdown."""
|
| 125 |
+
while not app_stop_event.is_set():
|
| 126 |
+
logger.info("=========== Polling stop event...")
|
| 127 |
time.sleep(0.1)
|
| 128 |
|
| 129 |
logger.info("App stop event detected, shutting down...")
|
|
|
|
| 131 |
stream_manager.close()
|
| 132 |
except Exception as e:
|
| 133 |
logger.error(f"Error while closing stream manager: {e}")
|
| 134 |
+
print("APP STOP EVENT:", "YES" if app_stop_event else "NO")
|
| 135 |
if app_stop_event:
|
| 136 |
threading.Thread(target=poll_stop_event, daemon=True).start()
|
| 137 |
|