(mode: str = "quick", source: str = "manual")
| 645 | |
| 646 | |
| 647 | def create_selfcheck_run(mode: str = "quick", source: str = "manual") -> Dict[str, Any]: |
| 648 | mode_text = "full" if str(mode or "").strip().lower() == "full" else "quick" |
| 649 | source_text = str(source or "manual").strip().lower() or "manual" |
| 650 | with get_db() as db: |
| 651 | run = SelfCheckRun( |
| 652 | run_uuid=str(uuid.uuid4()), |
| 653 | mode=mode_text, |
| 654 | source=source_text, |
| 655 | status=RUN_STATUS_PENDING, |
| 656 | result_data={"checks": [], "repairs": [], "progress": {"completed": 0, "total": 0}}, |
| 657 | ) |
| 658 | db.add(run) |
| 659 | db.commit() |
| 660 | db.refresh(run) |
| 661 | return _serialize_run(run) |
| 662 | |
| 663 | |
| 664 | def has_running_selfcheck_run() -> bool: |
no test coverage detected