MCPcopy Create free account
hub / github.com/vercel/vercel / shutdown

Function shutdown

packages/container/src/dev.ts:570–587  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

568 };
569
570 const shutdown = async (): Promise<void> => {
571 // Drop the cache entry first so a concurrent request starts a fresh
572 // container rather than reusing one that's being torn down.
573 runningContainers.delete(reuseKey);
574 try {
575 // `docker stop` causes the foreground `docker run --rm` to exit and
576 // removes the container.
577 await runForwarded('docker', ['stop', containerName], out, {
578 quiet: true,
579 });
580 } catch (err) {
581 debug(
582 `docker stop ${containerName} failed: ${(err as Error).message}`
583 );
584 } finally {
585 cleanupEnvFile();
586 }
587 };
588
589 // Poll for Docker's assigned host port. Any failure funnels through
590 // `shutdown()` so the container is stopped and the temp env-file (which

Callers 1

startContainerFunction · 0.70

Calls 4

debugFunction · 0.90
runForwardedFunction · 0.85
cleanupEnvFileFunction · 0.85
deleteMethod · 0.45

Tested by

no test coverage detected