mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
* fix(cli): check and snapshot keep their record while another app has the history open * test(cli): a held history no longer drops the snapshot record
16 lines
563 B
TypeScript
16 lines
563 B
TypeScript
import { HistoryBusyError, beginArtifactCapture } from "@hyperframes/studio-server/history";
|
|
import { withOwner } from "./historyOwner.js";
|
|
|
|
const SKIP_BUSY_HISTORY = { ownerWaitMs: 0 };
|
|
|
|
function unlessAnotherProcessKeepsTheHistory(error: unknown): void {
|
|
if (!(error instanceof HistoryBusyError)) throw error;
|
|
}
|
|
|
|
export async function captureArtifactRevision(projectDir: string) {
|
|
await withOwner(projectDir, (owner) => owner.checkpoint(), SKIP_BUSY_HISTORY).catch(
|
|
unlessAnotherProcessKeepsTheHistory,
|
|
);
|
|
return beginArtifactCapture(projectDir);
|
|
}
|