清理旧启动状态
This commit is contained in:
@@ -16,10 +16,6 @@ export async function bootstrapCoreServices(
|
||||
}
|
||||
|
||||
startupState.core.running = true;
|
||||
startupState.browser.status = "skipped";
|
||||
startupState.browser.message = "kuaishou lite mode";
|
||||
startupState.ocr.status = "skipped";
|
||||
startupState.ocr.message = "kuaishou lite mode";
|
||||
|
||||
while (!isShutdownStarted() && !startupState.core.ready) {
|
||||
startupState.phase =
|
||||
|
||||
@@ -12,16 +12,6 @@ export function createStartupState() {
|
||||
lastAttemptAt: "",
|
||||
lastError: "",
|
||||
},
|
||||
browser: {
|
||||
status: "pending",
|
||||
message: "",
|
||||
lastAttemptAt: "",
|
||||
},
|
||||
ocr: {
|
||||
status: "pending",
|
||||
message: "",
|
||||
lastAttemptAt: "",
|
||||
},
|
||||
process: {
|
||||
lastUnhandledRejection: null,
|
||||
lastUncaughtException: null,
|
||||
@@ -41,16 +31,6 @@ export function buildHealthPayload(startupState: StartupState, shutdownStarted:
|
||||
lastAttemptAt: startupState.core.lastAttemptAt,
|
||||
lastError: startupState.core.lastError,
|
||||
},
|
||||
browser: {
|
||||
status: startupState.browser.status,
|
||||
message: startupState.browser.message,
|
||||
lastAttemptAt: startupState.browser.lastAttemptAt,
|
||||
},
|
||||
ocr: {
|
||||
status: startupState.ocr.status,
|
||||
message: startupState.ocr.message,
|
||||
lastAttemptAt: startupState.ocr.lastAttemptAt,
|
||||
},
|
||||
process: {
|
||||
pid: process.pid,
|
||||
shutdownStarted,
|
||||
|
||||
@@ -125,18 +125,6 @@ function classifyRouteError(error: unknown): {
|
||||
return { statusCode: 409, errorCode: "conflict" };
|
||||
}
|
||||
|
||||
if (
|
||||
message.includes("OCR") ||
|
||||
message.includes("uv sync") ||
|
||||
message.includes("spawn uv ENOENT") ||
|
||||
message.includes("Executable doesn't exist") ||
|
||||
message.includes(
|
||||
"please run the following command to download new browsers"
|
||||
)
|
||||
) {
|
||||
return { statusCode: 503, errorCode: "dependency_unavailable" };
|
||||
}
|
||||
|
||||
return { statusCode: 500, errorCode: "internal_error" };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user