MCPcopy Index your code
hub / github.com/coder/mux / waitForWorkspaceRemoval

Function waitForWorkspaceRemoval

src/node/services/taskService.test.ts:135–149  ·  view source on GitHub ↗
(
  config: Config,
  workspaceId: string,
  timeoutMs = 20_000
)

Source from the content-addressed store, hash-verified

133}
134
135async function waitForWorkspaceRemoval(
136 config: Config,
137 workspaceId: string,
138 timeoutMs = 20_000
139): Promise<void> {
140 const start = Date.now();
141 while (findWorkspaceInConfig(config, workspaceId)) {
142 if (Date.now() - start > timeoutMs) {
143 throw new Error(`Timed out waiting for workspace cleanup (workspaceId=${workspaceId})`);
144 }
145
146 // Patch artifact readiness flips before the async cleanup recheck removes the child workspace.
147 await new Promise((resolve) => setTimeout(resolve, 50));
148 }
149}
150
151function createNullInitLogger() {
152 return {

Callers 1

Calls 1

findWorkspaceInConfigFunction · 0.85

Tested by

no test coverage detected