perf(selfop): route collected orders once after resolution

This commit is contained in:
2026-10-14 08:55:58 +08:00
parent c640fa2d0d
commit c0e1d42b62
2 changed files with 6 additions and 1 deletions
@@ -190,8 +190,10 @@ public class SelfopDiscoveryService {
SelfopProgressProjection.freezeRun(currentFetchTask,currentFetchRun);currentFetchRun.setStatus("ROUTED");currentFetchRun.setFetchFinishedAtUtc(utcNow());currentFetchRun.setFinishedAtUtc(utcNow());currentFetchRun.setUpdatedAt(utcNow());runs.updateById(currentFetchRun);
currentFetchTask.setStatus("SUCCEEDED");currentFetchTask.setUpdatedAt(utcNow());tasks.updateById(currentFetchTask);}
});
route(task,run,manifest,lease,false);
}
// Child tasks stay WAITING_SOURCE until all orders are resolved. Rebuilding every
// warehouse manifest after each order made this loop quadratic in directory size.
// A resumed attempt projects its current references before entering the loop.
// A directory warehouse is provisional until every account order (including resumed
// revision checks) has resolved. An empty warehouse must not publish a false zero early.
route(task,run,manifest,lease,true);