MCPcopy Create free account
hub / github.com/ShipSecAI/studio / cleanup

Method cleanup

worker/src/utils/isolated-volume.ts:436–452  ·  view source on GitHub ↗

* Cleans up the volume. Should be called in a finally block. * * @example * ```typescript * const volume = new IsolatedContainerVolume(tenantId, runId); * try { * await volume.initialize({ 'input.txt': 'data' }); * // ... use volume ... * } finally { * await volume.c

()

Source from the content-addressed store, hash-verified

434 * ```
435 */
436 async cleanup(): Promise<void> {
437 if (!this.volumeName) {
438 return; // Nothing to clean up
439 }
440
441 try {
442 await this.executeDockerCommand('volume', 'rm', [this.volumeName]);
443 } catch (error) {
444 // Log but don't throw - cleanup should be best-effort
445 console.error(
446 `Failed to cleanup volume ${this.volumeName}: ${error instanceof Error ? error.message : String(error)}`,
447 );
448 } finally {
449 this.isInitialized = false;
450 this.volumeName = undefined;
451 }
452 }
453
454 /**
455 * Executes a docker command using spawn.

Callers 11

executeFunction · 0.95
executeFunction · 0.95
executeFunction · 0.95
executeFunction · 0.95
executeFunction · 0.95
executeFunction · 0.95
executeFunction · 0.95
executeFunction · 0.95
executeFunction · 0.95
executeFunction · 0.95
initializeMethod · 0.95

Calls 2

executeDockerCommandMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected