feat: finalize corrected-route planning and Rerun recording review
This commit is contained in:
@@ -37,10 +37,15 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PlanningLiveTests:
|
||||
def __init__(self, drafts, sources, compute_lock):
|
||||
def __init__(self, drafts, sources, compute_lock, *, capture_recorder=None):
|
||||
self.drafts, self.sources, self.compute_lock = drafts, sources, compute_lock
|
||||
self.root = drafts.database.parent / "live-tests"
|
||||
self.root.mkdir(exist_ok=True)
|
||||
self.capture_recorder = capture_recorder
|
||||
if capture_recorder is not None:
|
||||
from .capture_catalog import reconcile_planning_captures
|
||||
|
||||
reconcile_planning_captures(self.root, capture_recorder)
|
||||
self.lock = threading.RLock()
|
||||
self.run = None
|
||||
self.sample = None
|
||||
@@ -177,6 +182,9 @@ class PlanningLiveTests:
|
||||
|
||||
def update(self, **values):
|
||||
with self.lock:
|
||||
capture = values.get("query_session_id")
|
||||
if capture and self.capture_recorder is not None:
|
||||
self.capture_recorder(capture, self.run["id"])
|
||||
self.run.update(values)
|
||||
self.revision += 1
|
||||
self.persist()
|
||||
|
||||
Reference in New Issue
Block a user