You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: centralize governance sync ownership in the scheduler
Adopt the orthogonal pieces of #1590 (which supersedes that PR's governance
sync rewrite with #1600's simpler single-attempt-per-run design while
keeping the #1600 5-minute cadence).
- tasks/sync-default-organizations{,-v2}.js: remove the nested
Governance.sync() trigger. Governance sync is now owned exclusively by
sync-governance-body{,-v2}.js on its scheduler cadence; this task just
reads whatever the local DB has and no-ops if orgList hasn't landed
yet. Fixes a race where the task could block on governance sync before
doing its own work.
- utils/data-loaders{,-v2}.js: drop the 50-retry recursive wait loop in
getDefaultOrganizationList{,V2}. On a fresh install where governance
data hasn't been synced, return [] instead of retrying internally; the
scheduler will re-run us on cadence. Also move the USE_SIMULATOR /
USE_DEVELOPMENT_MODE destructure into the functions so config reloads
aren't stale.
- controllers/governance{,-v2}.controller.js: harden POST
/governance/sync and POST /v2/governance/sync as fire-and-forget. The
model sync() methods already return cleanly on any failure (subscribe-
first pattern, scheduler retries on cadence); attach .catch defensively
so future exceptions are logged instead of becoming unhandled
rejections.
Does NOT adopt #1590's two-tier bootstrap/steady cadence (keeping #1600's
flat 300s default), the src/tasks/index.js scheduler refactor (not needed
without the promotion machinery), or the importOrganization
{ allowLongWait } option (that belongs to #1603).
Closes#1590 by folding in its compatible pieces.
0 commit comments