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

Function shutdownBuilder

packages/cli/src/util/dev/builder.ts:717–744  ·  view source on GitHub ↗
(match: BuildMatch)

Source from the content-addressed store, hash-verified

715}
716
717export async function shutdownBuilder(match: BuildMatch): Promise<void> {
718 const ops: Promise<void>[] = [];
719
720 if (match.buildProcess) {
721 const { pid } = match.buildProcess;
722 output.debug(`Killing builder sub-process with PID ${pid}`);
723 const killPromise = treeKill(pid!)
724 .then(() => {
725 output.debug(`Killed builder with PID ${pid}`);
726 })
727 .catch((err: Error) => {
728 output.debug(`Failed to kill builder with PID ${pid}: ${err}`);
729 });
730 ops.push(killPromise);
731 delete match.buildProcess;
732 }
733
734 if (match.buildOutput) {
735 for (const asset of Object.values(match.buildOutput)) {
736 if (asset.type === 'Lambda' && asset.fn) {
737 output.debug(`Shutting down Lambda function`);
738 ops.push(asset.fn.destroy());
739 }
740 }
741 }
742
743 await Promise.all(ops);
744}

Callers 2

updateBuildMatchesMethod · 0.90
stopMethod · 0.90

Calls 5

treeKillFunction · 0.90
debugMethod · 0.80
pushMethod · 0.65
valuesMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected