Initial commit of Descrybe v2 without local scratch artifacts.
Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/** Shared poll policy for platform-admin cutover readiness (P1-15). */
|
||||
|
||||
/** Interval between completed (non-abort) readiness fetches while polling. */
|
||||
export const CUTOVER_READINESS_POLL_MS = 60_000;
|
||||
|
||||
/**
|
||||
* Decide whether to hit GET /api/admin/readiness.
|
||||
* Dedupes in-flight + enforces a min interval so layout effect remounts cannot hammer the API.
|
||||
*/
|
||||
export function shouldRunCutoverReadinessFetch(input: {
|
||||
nowMs: number;
|
||||
lastAttemptAtMs: number;
|
||||
minIntervalMs: number;
|
||||
documentVisible: boolean;
|
||||
inFlight: boolean;
|
||||
force?: boolean;
|
||||
}): boolean {
|
||||
if (!input.documentVisible) return false;
|
||||
if (input.inFlight) return false;
|
||||
if (input.force) return true;
|
||||
if (
|
||||
input.lastAttemptAtMs > 0 &&
|
||||
input.nowMs - input.lastAttemptAtMs < input.minIntervalMs
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user