Record geo failover Args: fail_from: Database failed from fail_to: Database failed to reason: Reason for the failover
(
self,
fail_from: Union["SyncDatabase", "AsyncDatabase"],
fail_to: Union["SyncDatabase", "AsyncDatabase"],
reason: GeoFailoverReason,
)
| 321 | self.maintenance_notifications.add(1, attributes=attrs) |
| 322 | |
| 323 | def record_geo_failover( |
| 324 | self, |
| 325 | fail_from: Union["SyncDatabase", "AsyncDatabase"], |
| 326 | fail_to: Union["SyncDatabase", "AsyncDatabase"], |
| 327 | reason: GeoFailoverReason, |
| 328 | ): |
| 329 | """ |
| 330 | Record geo failover |
| 331 | |
| 332 | Args: |
| 333 | fail_from: Database failed from |
| 334 | fail_to: Database failed to |
| 335 | reason: Reason for the failover |
| 336 | """ |
| 337 | |
| 338 | if not hasattr(self, "geo_failovers"): |
| 339 | return |
| 340 | |
| 341 | attrs = self.attr_builder.build_geo_failover_attributes( |
| 342 | fail_from=fail_from, |
| 343 | fail_to=fail_to, |
| 344 | reason=reason, |
| 345 | ) |
| 346 | |
| 347 | return self.geo_failovers.add(1, attributes=attrs) |
| 348 | |
| 349 | def record_connection_count( |
| 350 | self, |