|
21 | 21 | from models import Bubble, ParseWarningCollector |
22 | 22 | from services.export_engine import WorkspaceOrchestration, prepare_workspace_orchestration |
23 | 23 | from services.summary_cache import ( |
| 24 | + fingerprint_workspace_storage, |
24 | 25 | get_cached_projects, |
25 | 26 | nocache_enabled, |
26 | 27 | set_cached_projects, |
27 | 28 | ) |
28 | 29 | from services.workspace_db import ( |
29 | 30 | COMPOSER_ROWS_WITH_HEADERS_SQL, |
| 31 | + collect_workspace_entries, |
| 32 | + global_storage_db_path, |
30 | 33 | load_project_layouts_for_composer, |
31 | 34 | load_project_layouts_map, |
32 | 35 | open_global_db, |
@@ -91,14 +94,29 @@ def list_workspace_projects( |
91 | 94 | :meth:`models.ParseWarningCollector.to_api_list`; empty when no skips. |
92 | 95 | """ |
93 | 96 | effective_nocache = nocache_enabled(request_nocache=nocache) |
94 | | - orch = prepare_workspace_orchestration( |
95 | | - workspace_path, rules, nocache=effective_nocache, |
96 | | - ) |
| 97 | + workspace_entries: list[dict[str, Any]] | None = None |
97 | 98 | if not effective_nocache: |
98 | | - cached = get_cached_projects(orch.fingerprint) |
| 99 | + workspace_entries = collect_workspace_entries(workspace_path) |
| 100 | + gdb = global_storage_db_path(workspace_path) |
| 101 | + cli_path = get_cli_chats_path() |
| 102 | + fingerprint = fingerprint_workspace_storage( |
| 103 | + workspace_path, |
| 104 | + workspace_entries, |
| 105 | + global_db_path=gdb if os.path.isfile(gdb) else None, |
| 106 | + rules=rules, |
| 107 | + cli_chats_path=cli_path if os.path.isdir(cli_path) else None, |
| 108 | + ) |
| 109 | + cached = get_cached_projects(fingerprint) |
99 | 110 | if cached is not None: |
100 | 111 | return cached |
101 | 112 |
|
| 113 | + orch = prepare_workspace_orchestration( |
| 114 | + workspace_path, |
| 115 | + rules, |
| 116 | + nocache=effective_nocache, |
| 117 | + workspace_entries=workspace_entries, |
| 118 | + ) |
| 119 | + |
102 | 120 | projects, warnings = _build_workspace_projects_uncached( |
103 | 121 | workspace_path, rules, orch, |
104 | 122 | ) |
|
0 commit comments