Skip to content

Commit

Permalink
Tweaks of the split off scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomirp committed Jan 16, 2025
1 parent 66f9a67 commit 4fe7230
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions scripts/cluster_topology_observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from time import sleep
from urllib.request import urlopen

from constants import API_REQUEST_TIMEOUT, PATRONI_CLUSTER_STATUS_ENDPOINT
API_REQUEST_TIMEOUT = 5
PATRONI_CLUSTER_STATUS_ENDPOINT = "cluster"

# File path for the spawned cluster topology observer process to write logs.
LOG_FILE_PATH = "/var/log/cluster_topology_observer.log"
Expand Down Expand Up @@ -45,7 +46,7 @@ def main():
sleep(30)
continue
current_cluster_topology = {
member["name"]: member["role"] for member in cluster_status.json()["members"]
member["name"]: member["role"] for member in cluster_status["members"]
}

# If it's the first time the cluster topology was retrieved, then store it and use
Expand Down
2 changes: 1 addition & 1 deletion scripts/rotate_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import subprocess
from time import sleep

from constants import PGBACKREST_LOGROTATE_FILE
PGBACKREST_LOGROTATE_FILE = "/etc/logrotate.d/pgbackrest.logrotate"


def main():
Expand Down

0 comments on commit 4fe7230

Please sign in to comment.