File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import asyncio
34from dataclasses import dataclass , field
45from pathlib import Path
56from typing import TYPE_CHECKING , Any
@@ -51,6 +52,17 @@ class WorkspaceContext:
5152 ws_action_schemas : dict [Path , dict [str , dict | None ]] = field (default_factory = dict )
5253 wal_writer : WalWriter | None = None
5354
55+ # Serializes the fast discovery phase of workspace mutations (addDir, removeDir,
56+ # startRunners): dir-list updates, filesystem scan, and projects_to_init
57+ # computation. Released before the slow runner-startup phase begins.
58+ workspace_state_lock : asyncio .Lock = field (default_factory = asyncio .Lock )
59+
60+ # Per-project initialization locks. Guard the slow per-project work: config
61+ # reading, preset resolution, and runner startup. Created once per project path
62+ # inside workspace_state_lock so they are always present before being awaited.
63+ # A locked entry means initialization is in progress for that project.
64+ project_init_locks : dict [Path , asyncio .Lock ] = field (default_factory = dict )
65+
5466
5567@dataclass
5668class CachedAction :
You can’t perform that action at this time.
0 commit comments