MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / cleanupWorkspaceDaemonFiles

Function cleanupWorkspaceDaemonFiles

src/daemon/daemon-registry.ts:324–344  ·  view source on GitHub ↗
(
  workspaceKey: string,
  options?: DaemonFileCleanupOptions,
)

Source from the content-addressed store, hash-verified

322 * Remove daemon metadata and socket for a workspace when owned or provably stale.
323 */
324export function cleanupWorkspaceDaemonFiles(
325 workspaceKey: string,
326 options?: DaemonFileCleanupOptions,
327): void {
328 const result = withDaemonRegistryMutationLock(workspaceKey, () => {
329 const registryPath = registryPathForWorkspaceKey(workspaceKey);
330 const removed = removeRegistryAtPathIfOwned(registryPath, workspaceKey, options);
331 if (!removed) {
332 return;
333 }
334
335 try {
336 unlinkSync(removed.socketPath);
337 } catch {
338 // ignore
339 }
340 });
341 if (result === null) {
342 throw new Error(`Unable to acquire daemon registry lock for ${workspaceKey}`);
343 }
344}

Callers 4

runDaemonCleanupFunction · 0.90
forceStopDaemonFunction · 0.90

Tested by

no test coverage detected