Record a geo failover. Args: fail_from: Database failed from fail_to: Database failed to reason: Reason for the failover
(
fail_from: "AsyncDatabase",
fail_to: "AsyncDatabase",
reason: GeoFailoverReason,
)
| 590 | |
| 591 | |
| 592 | async def record_geo_failover( |
| 593 | fail_from: "AsyncDatabase", |
| 594 | fail_to: "AsyncDatabase", |
| 595 | reason: GeoFailoverReason, |
| 596 | ) -> None: |
| 597 | """ |
| 598 | Record a geo failover. |
| 599 | |
| 600 | Args: |
| 601 | fail_from: Database failed from |
| 602 | fail_to: Database failed to |
| 603 | reason: Reason for the failover |
| 604 | """ |
| 605 | collector = _get_or_create_collector() |
| 606 | if collector is None: |
| 607 | return |
| 608 | |
| 609 | try: |
| 610 | collector.record_geo_failover( |
| 611 | fail_from=fail_from, |
| 612 | fail_to=fail_to, |
| 613 | reason=reason, |
| 614 | ) |
| 615 | except Exception: |
| 616 | pass |
| 617 | |
| 618 | |
| 619 | def reset_collector() -> None: |
no test coverage detected