MCPcopy
hub / github.com/redis/redis-py / record_geo_failover

Function record_geo_failover

redis/asyncio/observability/recorder.py:592–616  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

590
591
592async 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
619def reset_collector() -> None:

Callers 1

set_active_databaseMethod · 0.90

Calls 2

record_geo_failoverMethod · 0.80
_get_or_create_collectorFunction · 0.70

Tested by

no test coverage detected