mirror of
https://github.com/stablyai/orca.git
synced 2026-09-21 16:02:20 +00:00
Phase 6 of the relay split: the relay's deploy/operate surface moves under cloud/ with 24 cloud-* workflows gated on ORCA_CLOUD_OPERATIONS_ENABLED, the Cloud SQL rollout lease action, the relay Terraform root (dual-accept identities for both repositories), scripts, docs, CODEOWNERS, and a terraform validate job in Cloud Verify.
26 lines
800 B
JavaScript
26 lines
800 B
JavaScript
export function assertRelayLoadRampAccepted(rampConnectionFailures, maximum) {
|
|
if (rampConnectionFailures > maximum) {
|
|
throw new Error('relay load ramp exceeded the allowed connection failures')
|
|
}
|
|
}
|
|
|
|
export async function runRelayLoadWithShutdown(operation, shutdown) {
|
|
try {
|
|
return await operation()
|
|
} finally {
|
|
await shutdown()
|
|
}
|
|
}
|
|
|
|
export function relayLoadRunHasDisallowedFailures(result, config) {
|
|
return (
|
|
result.rampConnectionFailures > config.maxRampConnectionFailures ||
|
|
(!config.allowPlannedTransitionRetries && result.transitionConnectionFailures > 0) ||
|
|
result.steadyConnectionFailures > 0 ||
|
|
result.unexpectedCloses > config.maxUnexpectedCloses ||
|
|
result.protocolErrors > 0 ||
|
|
result.refreshErrors > 0 ||
|
|
result.socketErrors > 0
|
|
)
|
|
}
|