From 5d0d1117ea5c348c54a97ac812ae423f0e089d3c Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Fri, 24 Sep 2021 21:13:22 +0100 Subject: [PATCH] Show proxy manager threads in VScode debugger --- helpers/state_manager.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helpers/state_manager.py b/helpers/state_manager.py index c6133b5..6cf6140 100644 --- a/helpers/state_manager.py +++ b/helpers/state_manager.py @@ -5,6 +5,8 @@ import time from datetime import datetime from copy import copy from typing import Any, Dict, List +from setproctitle import setproctitle +from multiprocessing import current_process from baps_types.plan import PlanItem from helpers.logging_manager import LoggingManager @@ -28,6 +30,11 @@ class StateManager: rate_limit_params=[], rate_limit_period_s=5, ): + # When a StateManager is shared via proxy to other processes, it has a thread itself. + process_title = "StateManager Proxy" + setproctitle(process_title) + current_process().name = process_title + self.logger = logger path_dir: str = resolve_external_file_path("/state")