please bruh

This commit is contained in:
KingKDot
2026-03-06 13:07:56 -06:00
parent 14f8ab0353
commit 843213f4b1
@@ -34,6 +34,7 @@ export async function startBuildProcess(
deps: BuildProcessDeps,
): Promise<void> {
const SEVEN_DAYS_MS = 7 * 24 * 60 * 60 * 1000;
const BUILD_STREAM_HEARTBEAT_MS = 15_000;
const now = Date.now();
const build: BuildStream = {
@@ -69,6 +70,16 @@ export async function startBuildProcess(
});
};
const buildStartedAt = Date.now();
const keepAliveTimer = setInterval(() => {
const elapsedMinutes = Math.floor((Date.now() - buildStartedAt) / 60_000);
sendToStream({
type: "heartbeat",
elapsedMinutes,
timestamp: Date.now(),
});
}, BUILD_STREAM_HEARTBEAT_MS);
try {
const serverConfig = getConfig();
const buildAgentToken = (serverConfig.auth.agentToken || "").trim();
@@ -293,5 +304,7 @@ export async function startBuildProcess(
logger.info(`[build:${buildId.substring(0, 8)}] Cleaning up failed build stream`);
buildManager.deleteBuildStream(buildId);
}, 60 * 60 * 1000);
} finally {
clearInterval(keepAliveTimer);
}
}