Files
memind/server/portal-runtime-role.mjs
T

14 lines
466 B
JavaScript
Raw Normal View History

2026-07-26 19:51:44 +08:00
const RUNTIME_ROLES = new Set(['stable', 'candidate']);
export function resolvePortalRuntimeRole(env = process.env) {
const configured = String(env.MEMIND_RUNTIME_ROLE ?? '').trim().toLowerCase();
return RUNTIME_ROLES.has(configured) ? configured : 'stable';
}
export function isPassiveCanaryRuntime(env = process.env) {
return (
resolvePortalRuntimeRole(env) === 'candidate'
&& String(env.MEMIND_CANARY_PASSIVE_RUNTIME ?? '1').trim() !== '0'
);
}