Skip to content

Commit

Permalink
monodb/pgsql-health: feat: add leader_switch_hook
Browse files Browse the repository at this point in the history
  • Loading branch information
kreatoo committed Jul 18, 2024
1 parent 6e92b54 commit 5a751a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions configs/db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ postgres:
conn_percent: 70
alarm:
enabled: true
leader_switch_hook: "echo 'leader switch'"

mysql:
process_limit: 50
Expand Down
2 changes: 2 additions & 0 deletions scripts/monodb/pgsql-health.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function parse_config_pgsql() {

SEND_ALARM=$(yaml .postgres.alarm.enabled $CONFIG_PATH_MONODB "$SEND_ALARM")

LEADER_SWICH_HOOK=$(yaml .postgres.leader_switch_hook $CONFIG_PATH_MONODB "")

if [ -z "$PATRONI_API" ] && [ -f /etc/patroni/patroni.yml ]; then
PATRONI_API="$(yq -r .restapi.listen /etc/patroni/patroni.yml)"
fi
Expand Down

0 comments on commit 5a751a0

Please sign in to comment.