Stop workspace before deleting — Coder returns 405 on running workspaces
Publish Image / publish (push) Successful in 21s
Publish Image / publish (push) Successful in 21s
The DELETE API requires the workspace to be stopped first. Now stops, waits 10s for shutdown, then deletes. This was causing workspaces to never be cleaned up after task completion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
b43e38ec54
commit
a6ff7b7fb5
+5
-1
@@ -127,10 +127,14 @@ export class TaskQueue {
|
||||
this.active.delete(workspaceName);
|
||||
|
||||
try {
|
||||
await this.coder.stopWorkspace(entry.workspaceId);
|
||||
console.log(`[queue] workspace stopped: ${workspaceName} — waiting for shutdown`);
|
||||
// Wait for the workspace to fully stop before deleting
|
||||
await new Promise((resolve) => setTimeout(resolve, 10_000));
|
||||
await this.coder.deleteWorkspace(entry.workspaceId);
|
||||
console.log(`[queue] workspace deleted: ${workspaceName}`);
|
||||
} catch (err) {
|
||||
console.error(`[queue] failed to delete workspace ${workspaceName}:`, err);
|
||||
console.error(`[queue] failed to clean up workspace ${workspaceName}:`, err);
|
||||
}
|
||||
|
||||
// Drain in case pending tasks were waiting for capacity
|
||||
|
||||
Reference in New Issue
Block a user