清理旧启动状态
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
快手轻量后端服务。
|
快手轻量后端服务。
|
||||||
|
|
||||||
后端负责订单入库、履约任务编排、快手 Cloud / 91 卡券 / 快手小店核销配置、后台管理接口和数据库迁移。默认入口就是轻量后端,不再包含浏览器会话或 OCR 链路。
|
后端负责订单入库、履约任务编排、快手 Cloud / 91 卡券 / 快手小店核销配置、后台管理接口和数据库迁移。默认入口就是快手轻量后端。
|
||||||
|
|
||||||
## 快速启动
|
## 快速启动
|
||||||
|
|
||||||
|
|||||||
@@ -16,10 +16,6 @@ export async function bootstrapCoreServices(
|
|||||||
}
|
}
|
||||||
|
|
||||||
startupState.core.running = true;
|
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) {
|
while (!isShutdownStarted() && !startupState.core.ready) {
|
||||||
startupState.phase =
|
startupState.phase =
|
||||||
|
|||||||
@@ -12,16 +12,6 @@ export function createStartupState() {
|
|||||||
lastAttemptAt: "",
|
lastAttemptAt: "",
|
||||||
lastError: "",
|
lastError: "",
|
||||||
},
|
},
|
||||||
browser: {
|
|
||||||
status: "pending",
|
|
||||||
message: "",
|
|
||||||
lastAttemptAt: "",
|
|
||||||
},
|
|
||||||
ocr: {
|
|
||||||
status: "pending",
|
|
||||||
message: "",
|
|
||||||
lastAttemptAt: "",
|
|
||||||
},
|
|
||||||
process: {
|
process: {
|
||||||
lastUnhandledRejection: null,
|
lastUnhandledRejection: null,
|
||||||
lastUncaughtException: null,
|
lastUncaughtException: null,
|
||||||
@@ -41,16 +31,6 @@ export function buildHealthPayload(startupState: StartupState, shutdownStarted:
|
|||||||
lastAttemptAt: startupState.core.lastAttemptAt,
|
lastAttemptAt: startupState.core.lastAttemptAt,
|
||||||
lastError: startupState.core.lastError,
|
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: {
|
process: {
|
||||||
pid: process.pid,
|
pid: process.pid,
|
||||||
shutdownStarted,
|
shutdownStarted,
|
||||||
|
|||||||
@@ -125,18 +125,6 @@ function classifyRouteError(error: unknown): {
|
|||||||
return { statusCode: 409, errorCode: "conflict" };
|
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" };
|
return { statusCode: 500, errorCode: "internal_error" };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# 快手轻量后端镜像:不安装 Playwright / Chromium / OCR 依赖。
|
# 快手轻量后端镜像
|
||||||
FROM docker.m.daocloud.io/library/node:22-bookworm AS builder
|
FROM docker.m.daocloud.io/library/node:22-bookworm AS builder
|
||||||
|
|
||||||
ARG DEBIAN_MIRROR=mirrors.cloud.tencent.com
|
ARG DEBIAN_MIRROR=mirrors.cloud.tencent.com
|
||||||
|
|||||||
Reference in New Issue
Block a user