Skip to content

Commit 8f75f0d

Browse files
author
avandras
committed
Fix most Pyright issues in ha.py
1 parent 033cea6 commit 8f75f0d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

patroni/ha.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def is_standby_cluster(self) -> bool:
285285
return self.patroni.multisite.is_active and not self.patroni.multisite.is_leader_site() \
286286
or global_config.is_standby_cluster
287287

288-
def get_standby_cluster_config(self):
288+
def get_standby_cluster_config(self) -> Any:
289289
if self.patroni.multisite.is_active:
290290
return self.patroni.multisite.get_active_standby_config()
291291
return global_config.get_standby_cluster_config()
@@ -362,7 +362,8 @@ def acquire_lock(self) -> bool:
362362
multisite_ret = self.patroni.multisite.resolve_leader()
363363
if multisite_ret:
364364
logger.error("Releasing leader lock because multi site status is: " + multisite_ret)
365-
self.dcs.delete_leader()
365+
# self.dcs.delete_leader()
366+
self._delete_leader()
366367
return False
367368
return ret
368369

@@ -1583,7 +1584,7 @@ def on_shutdown(checkpoint_location: int, prev_location: int) -> None:
15831584
status['released'] = True
15841585

15851586
if mode == 'multisite':
1586-
on_shutdown = self.patroni.multisite.on_shutdown # noqa: F811
1587+
on_shutdown = self.patroni.multisite.on_shutdown # pyright: ignore [reportAssignmentType] # noqa: F811
15871588

15881589
def before_shutdown() -> None:
15891590
if self.state_handler.mpp_handler.is_coordinator():

0 commit comments

Comments
 (0)