MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / markStaleForProject

Function markStaleForProject

desktop/runtime/settings-refresh.ts:167–188  ·  view source on GitHub ↗
(projectPath?: string | undefined | null | undefined)

Source from the content-addressed store, hash-verified

165 }
166
167 function markStaleForProject(projectPath?: string | undefined | null | undefined) {
168 if (projectPath !== null && projectPath !== undefined && projectPath.trim().length === 0) {
169 return
170 }
171
172 const normalizedProjectPath = projectPath ? path.resolve(projectPath) : ''
173 for (const { runtimeKey, runtimePromise } of getRuntimeRecords()) {
174 void (async () => {
175 try {
176 const runtime = await runtimePromise
177 if (normalizedProjectPath && path.resolve(runtime.cwd) !== normalizedProjectPath) {
178 return
179 }
180
181 staleGenerations.set(runtimeKey, (staleGenerations.get(runtimeKey) ?? 0) + 1)
182 await reloadIfSafe(runtimeKey)
183 } catch {
184 // Ignore stale runtime reload failures; a later refresh will retry.
185 }
186 })()
187 }
188 }
189
190 function markStaleForSettingsCwd(settingsCwd?: string | undefined | null | undefined) {
191 if (!settingsCwd?.trim()) return

Callers

nothing calls this directly

Calls 2

reloadIfSafeFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected