Skip to content

Commit 338b035

Browse files
author
avandras
committed
Fix misdirected logic
1 parent 6c4cf98 commit 338b035

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

patroni/ctl.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,14 +1755,13 @@ def get_cluster_service_info(cluster: Dict[str, Any]) -> List[str]:
17551755
for m in cluster['members']:
17561756
if 'latest_end_lsn' in m and 'lag_to_primary' in m:
17571757
r.update(m)
1758-
if r['latest_end_lsn'] and r['lag_to_primary']:
1758+
if r['latest_end_lsn']:
17591759
lag_to_primary = r['lag_to_primary']
17601760
lag_to_primary = round(lag_to_primary / 1024 / 1024) if isinstance(lag_to_primary, int) \
17611761
else lag_to_primary
1762-
if r['latest_end_lsn'] and lag_to_primary:
1763-
info = (f"The latest known LSN of the primary instance is {r['latest_end_lsn']}, "
1764-
f"the replication lag is {lag_to_primary} MB")
1765-
service_info.append(info)
1762+
info = (f"The latest known LSN of the primary instance is {r['latest_end_lsn']}, "
1763+
f"the replication lag is {lag_to_primary} MB")
1764+
service_info.append(info)
17661765

17671766
if cluster.get('pause'):
17681767
service_info.append('Maintenance mode: on')

0 commit comments

Comments
 (0)