fix(workbench): keep read retries within web budget (#1921)

This commit is contained in:
Lyon
2026-06-22 20:56:53 +08:00
committed by GitHub
parent a0b3d310d3
commit ce426893cd
3 changed files with 29 additions and 5 deletions
+13
View File
@@ -940,6 +940,7 @@ function deployServicesForProfile(deploy, profile) {
serviceDeclarationEnvForProfile(deploy, profile, service.serviceId),
runtimeStoreEnvForProfile(deploy, profile, service.serviceId),
workbenchRuntimeClientEnvForProfile(deploy, profile, service.serviceId),
workbenchRuntimeFactsQueryEnvForProfile(deploy, profile, service.serviceId),
workbenchRuntimePostgresEnvForProfile(deploy, profile, service.serviceId),
workbenchRuntimeRedisEnvForProfile(deploy, profile, service.serviceId)
);
@@ -955,6 +956,7 @@ function deployServicesForProfile(deploy, profile) {
serviceDeclarationEnvForProfile(deploy, profile, override.serviceId),
runtimeStoreEnvForProfile(deploy, profile, override.serviceId),
workbenchRuntimeClientEnvForProfile(deploy, profile, override.serviceId),
workbenchRuntimeFactsQueryEnvForProfile(deploy, profile, override.serviceId),
workbenchRuntimePostgresEnvForProfile(deploy, profile, override.serviceId),
workbenchRuntimeRedisEnvForProfile(deploy, profile, override.serviceId)
)
@@ -1062,6 +1064,17 @@ function workbenchRuntimeClientEnvForProfile(deploy, profile, serviceId) {
return env;
}
function workbenchRuntimeFactsQueryEnvForProfile(deploy, profile, serviceId) {
if (!isRuntimeLane(profile) || serviceId !== "hwlab-cloud-api") return {};
const factsQuery = runtimeLaneConfig(deploy, profile)?.workbenchRuntime?.factsQuery;
if (!factsQuery || typeof factsQuery !== "object" || Array.isArray(factsQuery)) return {};
const env = {};
if (Number.isInteger(factsQuery.maxAttempts)) env.HWLAB_WORKBENCH_FACTS_QUERY_MAX_ATTEMPTS = String(factsQuery.maxAttempts);
if (Number.isInteger(factsQuery.backoffBaseMs)) env.HWLAB_WORKBENCH_FACTS_QUERY_BACKOFF_BASE_MS = String(factsQuery.backoffBaseMs);
if (Number.isInteger(factsQuery.backoffMaxMs)) env.HWLAB_WORKBENCH_FACTS_QUERY_BACKOFF_MAX_MS = String(factsQuery.backoffMaxMs);
return env;
}
function workbenchRuntimePostgresEnvForProfile(deploy, profile, serviceId) {
if (!isRuntimeLane(profile) || serviceId !== "hwlab-workbench-runtime") return {};
const postgres = runtimeLaneConfig(deploy, profile)?.workbenchRuntime?.postgres;