from __future__ import annotations import argparse import json from app import create_app def run(reconciler, *, repair=False): return reconciler.reconcile(repair=repair) def main(): parser = argparse.ArgumentParser(description="Reconcile data-research control and projection stores") parser.add_argument("--repair", action="store_true", help="repair rebuildable projections") args = parser.parse_args() app = create_app() with app.app_context(): factory = app.extensions.get("data_research_reconciler_factory") if factory is None: raise RuntimeError("data-research reconciliation adapters are not configured") print(json.dumps(run(factory(), repair=args.repair), ensure_ascii=False, sort_keys=True)) if __name__ == "__main__": main()