drupflare/worker - v1.0.0
    Preparing search index...

    Function buildPlanUnits

    • Turns what PHP enumerated into the ordered unit list.

      Kept in JS, and pure, so the ordering rules are gate-testable without an interpreter. The order is DbUpdateController::triggerBatch()'s, not an improvement on it:

      1. every allowed hook_update_N in dependency order;
      2. only if post-updates are pending, a full cache flush, then each hook_post_update_NAME in the registry's own sorted order;
      3. a final full cache flush, unconditionally -- batchFinished() flushes even when there was nothing to do;
      4. maint_off.

      Each "full cache flush" expands to UPDB_FLUSH_STEPS, eleven bounded units, when flushSplit is true (the default). With flushSplit: false it is one unit that calls drupal_flush_all_caches() -- which cannot fit a free-plan invocation, measured at 282.9 ms in wasm, so that setting requires allowUnbounded as well and exists for paid plans only.

      Parameters

      • plan: UpdbUnitResult

        the JSON updbPlan() printed

      • options: { allowUnbounded?: boolean; flushSplit?: boolean; maintTarget?: boolean } = {}

      Returns PlanUnit[]