MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / waitForPauseMarker

Function waitForPauseMarker

apps/local/src/db/v1-v2-migration.test.ts:735–774  ·  view source on GitHub ↗
(
  marker: string,
  child: ChildProcessWithoutNullStreams,
  output: ChildOutput,
)

Source from the content-addressed store, hash-verified

733}
734
735const waitForPauseMarker = async (
736 marker: string,
737 child: ChildProcessWithoutNullStreams,
738 output: ChildOutput,
739): Promise<{
740 readonly markerFound: boolean;
741 readonly exitCode: number | null;
742 readonly signalCode: NodeJS.Signals | null;
743 readonly stdout: string;
744 readonly stderr: string;
745}> => {
746 for (let attempt = 0; attempt < 200; attempt++) {
747 if (existsSync(marker)) {
748 return {
749 markerFound: true,
750 exitCode: child.exitCode,
751 signalCode: child.signalCode,
752 stdout: output.stdout,
753 stderr: output.stderr,
754 };
755 }
756 if (child.exitCode !== null || child.signalCode !== null) {
757 return {
758 markerFound: false,
759 exitCode: child.exitCode,
760 signalCode: child.signalCode,
761 stdout: output.stdout,
762 stderr: output.stderr,
763 };
764 }
765 await new Promise((resolve) => setTimeout(resolve, 25));
766 }
767 return {
768 markerFound: false,
769 exitCode: child.exitCode,
770 signalCode: child.signalCode,
771 stdout: output.stdout,
772 stderr: output.stderr,
773 };
774};
775
776const killMigrationAtPause = async (input: {
777 readonly dbPath: string;

Callers 1

killMigrationAtPauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected