please bruh
This commit is contained in:
@@ -34,6 +34,7 @@ export async function startBuildProcess(
|
|||||||
deps: BuildProcessDeps,
|
deps: BuildProcessDeps,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const SEVEN_DAYS_MS = 7 * 24 * 60 * 60 * 1000;
|
const SEVEN_DAYS_MS = 7 * 24 * 60 * 60 * 1000;
|
||||||
|
const BUILD_STREAM_HEARTBEAT_MS = 15_000;
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|
||||||
const build: BuildStream = {
|
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 {
|
try {
|
||||||
const serverConfig = getConfig();
|
const serverConfig = getConfig();
|
||||||
const buildAgentToken = (serverConfig.auth.agentToken || "").trim();
|
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`);
|
logger.info(`[build:${buildId.substring(0, 8)}] Cleaning up failed build stream`);
|
||||||
buildManager.deleteBuildStream(buildId);
|
buildManager.deleteBuildStream(buildId);
|
||||||
}, 60 * 60 * 1000);
|
}, 60 * 60 * 1000);
|
||||||
|
} finally {
|
||||||
|
clearInterval(keepAliveTimer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user